[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: Stefan
Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478.
Date: Mon, 24 Mar 2014 14:32:05 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

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

You might get used to "RET reindents" and stop hitting TAB that often ;-)
For me one of the reasons why it's not gratuitous is because of things like:


Go to just before "blibli" and type "end RET": notice that hitting TAB
just before RET won't help you, because you need to reindent the line
after the newline is inserted.

This is admittedly less serious for interactive editing than for
keyboard macros (and templates/skeletons/snippets), but I find the
behavior to be handy.

> The modes where reindenting the current line on RET is beneficial often,
> can add `?\n' to electric-indent-chars themselves.

Indeed, we could do that.

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

Good point.

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

Again "just swapping" sounds simple, but I'm not sure what patch you
have in mind.  I think it's important for the user to be able to easily
say something like (electric-indent-mode -1) (and/or its buffer-local
equivalent) to recover the Emacs-23 behavior.


reply via email to

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