Colin Rafferty writes:
This is a major change, so I thought it would be better to throw
this
out to the list, rather than just submitting a patch.
For the last umpteen years, I have had the following two lines in .emacs:
(global-set-key [(return)] 'newline-and-indent)
(global-set-key [(linefeed)] 'newline)
I cannot understand anyone who does not also have this. It does the
right thing everywhere. In source buffers, it indents properly. In
non-source buffers, it indents properly (i.e. not at all).
Of all the people that I have shown this to, only one has not changed
his bindings to match. There seems to me no reason why we should not
make this the default.
I imagine that somewhere in the dark past, there was no function
`newline-and-indent', and that is why we still don't bind it to
<return> by default.
I propose that we make a change for the better. We should change one
of the most used keys on the keyboard to a smarter and more functional
binding.
Does anyone disagree?
I don't consider it adviseable. The issue is the potential for
surprise and frustration. If a new user edits some file with an
extension which just happens to throw the buffer into some foreign
mode that he doesn't understand, and things work differently in that
mode, and he doesn't know how to "make it act sane", it can be
extremely frustrating.
Popularizing the mod you suggest by putting some suggestive comment in
sample.emacs, seems more well advised to me.
Personally, I just hit C-j whenever I'm in a programming mode. One
reason this makes sense is because of commenting. Some programming
modes have some wierd "comment gravity" behavior (sorry I don't know
the proper name for this curiously adictive bizardom), where a comment
will be auto indented, but to different places depending on where you
were when you started it. If you hit C-j, and you drop to the
reindent column, and start typing a comment it may stay there, move
right, move left, etc. If you hit return, to go to leftmost column of
next row, and start typing a comment, it might stay there, which might
be a different location than in the preceding scenario. If that's
what you want, having "return" not go there, is maddening.
IMO, it is easier for the eclectic to learn to customize, than for the
novice to learn to uncustomize. Spoken as one who is better than
novice and poorer than eclectic.
--
Geoffrey Furnish Actel Corporation furnish(a)actel.com
Senior Staff Engineer 955 East Arques Ave voice: 408-522-7528
Placement & Routing Sunnyvale, CA 94086-4533 fax: 408-328-2303