tabs in Sage library souces - #5653 and #5848

1 view
Skip to first unread message

mabshoff

unread,
Apr 21, 2009, 8:07:59 PM4/21/09
to sage-devel
Hello folks,

up to now the rules on tabs in Sage library sources has been "don't
use them", but there was never any enforcement and/or systematic
detection since no side effect of using tabs has even been detected.
As it turns out #5653 exposes a case where tabs cause problems when
rendering docstrings in a pretty way in the notebook.

At #5848 John Palmieri posted a patch converting all tabs in the Sage
library to spaces. This kind of patch is likely to break some patches
that used to work and it is generally not too nice to do "white space
only" patches for exactly that reason. But this case is somewhat
special since it will allow #5653 to work better and once you have
seen that patch in action in the notebook you will likely agree that a
little short term pain is well worth the potential rebasing problem.

If this goes into 3.4.1.final it needs to be done soon, i.e. less than
two hours. John is happy to rebase the patch at #5848, so it could be
the last patch to go into 3.4.2, too, for example.

Thoughts?

Cheers,

Michael

Nick Alexander

unread,
Apr 21, 2009, 10:57:33 PM4/21/09
to sage-...@googlegroups.com

On 21-Apr-09, at 5:07 PM, mabshoff wrote:

>
> Hello folks,
>
> up to now the rules on tabs in Sage library sources has been "don't
> use them", but there was never any enforcement and/or systematic
> detection since no side effect of using tabs has even been detected.

Not really: python rejects any file with tabs in it, or is intended
to. I say apply -- tabs must die!

Nick

mabshoff

unread,
Apr 21, 2009, 11:08:25 PM4/21/09
to sage-devel
Well, it clearly works at the moment, otherwise Sage wouldn't even
start :)

> I say apply -- tabs must die!

Die, die, die!

> Nick

Cheers,

Michael

Rob Beezer

unread,
Apr 22, 2009, 2:15:17 AM4/22/09
to sage-devel
There's a positive review up for #5848, but clearly I wasn't fast
enough. ;-)

#5653 causes tab-completion in the notebook to display the docstring
or source code formatted very nicely using HTML, just as it looks in
the reference manual. Lots of color and syntax highlighting, and TeX
rendered properly. Its worth experimenting with just to get a sneak
preview.

But it could also use a referee who knows the notebook and the
documentation system. Hint, hint.

Rob

mabshoff

unread,
Apr 22, 2009, 2:22:16 AM4/22/09
to sage-devel


On Apr 21, 11:15 pm, Rob Beezer <goo...@beezer.cotse.net> wrote:
> There's a positive review up for #5848, but clearly I wasn't fast
> enough.  ;-)

Yeah, after talking about it with some people in IRC it seems that
there wasn't any strong consensus. And John Palmieri had pointed out
that he can easily rebase the patch, so my current plan for this path
to get it into 3.4.2.final once we get closer. That way trac should be
more or less empty of mergable patches and everybody should be happy.

> #5653 causes tab-completion in the notebook to display the docstring
> or source code formatted very nicely using HTML, just as it looks in
> the reference manual.  Lots of color and syntax highlighting, and TeX
> rendered properly.   Its worth experimenting with just to get a sneak
> preview.

Yeah, that patch absolutely rocks and it is hard to understand why it
is so great unless you play with it. One suggested improvement was to
add some mechanism you could "tear off" or "pop out" a help page just
like Google chat for example.

> But it could also use a referee who knows the notebook and the
> documentation system.  Hint, hint.

:)

> Rob

Cheers,

Michael

John Cremona

unread,
Apr 22, 2009, 4:50:53 AM4/22/09
to sage-...@googlegroups.com
In my experience (using emacs which puts tabs in) there has never been
a problem in .py files, but .pyx files would fail to build unless I
use the emacs "untabify" command before rebuilding a file I have
edited.

John

2009/4/22 mabshoff <mabs...@googlemail.com>:
Reply all
Reply to author
Forward
0 new messages