Didier Verna writes:
Colin Rafferty writes:
Colin> (global-set-key [(return)] 'newline-and-indent)
But sometimes, you _don't_ want to indent. In C, for
instance, you
might want to make a few blank lines before the next line of code.
The first line in `newline-and-indent':
(delete-region (point) (progn (skip-chars-backward " \t") (point)))
So when you just hit return to move through the lines, only the last
line is indented (the one that you end up on).
And you don't want them to be indented because otherwise, Martin
is
going to send a mega-patch to correct this ;-)
Now he will never need to, since `newline-and-indent' removes all
trailing whitespace from the lines that you leave.
Making people oblidged to use C-j instead of Return to simply
go to
the next line is too much to ask, I think.
I see it the other way around. 99% of the time that you hit <return>
when writing code, the next key that you type is <tab>.
And anyway, when you end up on the line that you want, it will already
be indented according to your defaults.
--
Colin