[Top][All Lists]

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

Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC

From: Dmitry Gutov
Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478.
Date: Mon, 24 Mar 2014 11:08:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

"Stephen J. Turnbull" <address@hidden> writes:

> That is, if what Alan means by "type RET" is "type a keystroke bound
> to `newline'", then my preference accords with his.  For my usage that
> behavior is *clearly* *wrong*, as in text modes when there's leading
> whitespace on a line, either *I* put it there, or some electrically-
> crapified command that I just disabled the electricity on did (and it
> won't happen again, so there's no reason not to fix it by hand this
> time).

FWIW, effectively doing `reindent-then-newline-and-indent' on RET also
seems gratuitous to me. When I reach the end of a line, usually text on
that line is already indented correctly (automatically, or through me
typing TAB manually), so the first `reindent' does nothing, unless the
indentation function was wrong about the current line in the first
place, and I had to adjust it manually.

The modes where reindenting the current line on RET is beneficial often,
can add `?\n' to electric-indent-chars themselves. For most, the
benefits are marginal and they are offset by having to tweak
`electric-indent-inhibit' or
`electric-indent-functions-without-reindent' for existing text-based

For all others, just swapping C-j and RET bindings would've worked just
as well, and I think it would result in simpler code.

reply via email to

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