[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: binding for RET in python.el
From: |
Stefan Monnier |
Subject: |
Re: binding for RET in python.el |
Date: |
Wed, 26 Apr 2006 12:54:49 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> I got this comment from users that transitioned from using
> python-mode.el with emacs-21 to python.el from emacs-22.
> In python-mode.el RET does a newline-and-indent, and IMHO it makes
> a lot sense for python code.
> Is there any reason not to do the same for python.el?
It makes sense for other modes as well. In Emacs it's normally considered
a preference which users can choose by doing something like:
(global-set-key ?\r 'newline-and-indent)
or by hitting LFD (i.e. C-j) instead of RET.
Now, that doesn't mean that it's necessarily wrong for a major mode to
explicitly bind RET to newline-and-indent, but that it needs to be justified
by an argument that basically says that if even if a user generally prefers
using just `newline' in all other major modes, he'll probably want to use
`newline-and-indent' in python.el. I don't use Python myself, so I can't
really judge, but by the looks of it I see nothing that makes Python special
in this regard (I know about the indentation-sensitive syntax, but it's
pretty common to consider misindentation to be a (minor) bug in other
languages as well (even though the compiler won't detect it)).
Stefan