[Top][All Lists]

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

bug#35254: 27.0.50; cc-mode/electric-pair-mode/electric-layout-mode: bad

From: Noam Postavsky
Subject: bug#35254: 27.0.50; cc-mode/electric-pair-mode/electric-layout-mode: bad trailing whitespace behavior in cc-mode
Date: Mon, 13 May 2019 19:45:49 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>> Electric indent mode's post-self-insert hook entry has 3 effects:
>>> 1. Indent the previous line.
>>> 2. Remove trailing whitespace from the previous line.
>>> 3. Indent the current line (when at beginning of line).
> Note that `newline` itself already does some subset of 2 (before running
> electric-indent's post-self-insert hook).

Do you mean `newline-and-indent`?   Or are you talking about the margin
stuff? (which doesn't apply to progmodes usually, as far as I can tell).

> I don't understand why you distinguish
>     electric-indent-inhibit
> from
>     (memq indent-line-function
>           electric-indent-functions-without-reindent)
> When I introduced these, electric-indent-functions-without-reindent was
> only meant to paper over those pre-existing cases that don't set
> electric-indent-inhibit.
> So, I'd suggest an even simpler patch which just closes the `unless`
> earlier.  Would that work?

It has the same effect as Alan's patch: effectively reverses a bit of
João's "electric-layout-mode kicks in before electric-pair-mode" change,
and breaks the same 3 tests I mentioned in https://debbugs.gnu.org/35254#50.

reply via email to

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