emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binding for RET in python.el


From: Dan Nicolaescu
Subject: Re: binding for RET in python.el
Date: Wed, 26 Apr 2006 10:21:41 -0700

Stefan Monnier <address@hidden> writes:

  > > 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)).

IMO in the particular case of python binding RET to newline-and-indent
makes sense.
I use python, and after a few days of having newline-and-indent bound
to RET I can conclude that it feels much better. 

Another argument is that python-mode.el does this by default, so the
python users have come to expect it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]