Waffling between Python and Ruby

Huaiyu Zhu hzhu at knowledgetrack.com
Fri Jun 16 12:51:54 EDT 2000


Oops!  You're right, as several people also pointed out to me in email.
Actually I had this in .emacs and didn't realize it for years:

(setq-default tab-width 4)

I am not aware of serious adverse effect, though.  The good thing is that
changing indentation is really easy.  You can use one keystroke backspace or
C-d, for example.  Presumably the evil will manifest itself when dealing
with other programs, but I also set 'less -x4' so I don't even see it.

Wondering what other people will see when reading my programs ...

-- 
Huaiyu Zhu                       hzhu at users.sourceforge.net
Matrix for Python Project        http://MatPy.sourceforge.net 


On 14 Jun 2000 21:57:29 -0400, David Bolen <db3l at fitlinxx.com> wrote:
>(dropped comp.lang.ruby since the whitespace is Python only)
>
>hzhu at knowledgetrack.com (Huaiyu Zhu) writes:
>
>> If you use emacs:
>> 
>> C-x h M-x tabify
>> 
>> will tabify the whole buffer.  I always do this when doing copy and paste
>> from news groups, and do an untabify the other way round.  This is because
>> the default tab space is 4 in emacs (which is sane) but 8 everywhere else.
>
>The default tab stop for a physical TAB character in Emacs is 8, which
>is the most sane value.  A TAB character in an Emacs buffer is, by
>default, treated as moving to the next boundary that is a multiple of
>8 by default.  The tab stop width can in theory be overridden (see
>variables default-tab-width and buffer-local tab-width), but doing so
>is just plain evil.
>
>Instead of changing tab stops, it is far preferable to set the
>indentation for coding in various modes to anything you want (and
>Python mode will default to 4).  When inserting indentation, Emacs
>will use a mixture of TABs and spaces to get you where you need to be
>in the most efficient manner, assuming the 8-character TAB multiple.
>
>Or to put it more succinctly - the default Emacs interpretation of the
>TAB physical character and Python's interpretation are the same, and
>you should be perfectly safe letting Emacs mix TABs and spaces for
>Python code, unless you've reset the default tab stops, which as I
>mentioned above would be evil :-)
>
>That said, the Python mode keeps everything with spaces anyway.
>
>--
>-- David




More information about the Python-list mailing list