bug-gnu-emacs
[Top][All Lists]
Advanced

[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: Alan Mackenzie
Subject: bug#35254: 27.0.50; cc-mode/electric-pair-mode/electric-layout-mode: bad trailing whitespace behavior in cc-mode
Date: Wed, 15 May 2019 10:03:39 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Hello, João.

On Tue, May 14, 2019 at 11:34:24 +0100, João Távora wrote:
> On Tue, May 14, 2019 at 10:27 AM Alan Mackenzie <acm@muc.de> wrote:

> > The bug is, type lots of <CR>s in a row; the indentation WS isn't
> > getting removed from the blank lines.  Currently electric-indent-inhibit
> > is inhibiting this removal.


> Do you mean the "removal of the WS in the lines preceding the current".
> In other words, do you mean "removal of the trailing WS that was once
> proper indentation"?

Yes.  To be absolutely clear, supposing we have point at the end of a
line containing nothing but indentation space (e.g., we've just typed
<CR>):

<spaces>!
        ^
      point

Type <CR> again.  What we are currently seeing is:

<spaces>
<spaces>!

.  What we want to see is

<nothing>
<spaces>!

.

> Or do you think that the current line, the one where point stands, should
> not be indented at all in certain electric-* variable combinations and or
> c-electric-* variable?  Which of those combinations?

When electric-indent-inhibit is set, the (electric) indentation of the
current line should not be done by electric-indent-mode.  For the
moment, in CC Mode it should be done by c-electric-brace, and friends,
if so configured in CC Mode (the default being enabled).

> > Probably.  Maybe João should check this, once he's fully back with us.


> I'm afraid I can't put a date on that. There's a bun in the oven...

Well, congratulations!  I hope everything goes well.

> An important development towards figuring out this issue is that a
> significant fraction of us agrees on what the behavior should be
> in what cases.  Then we should code tests that assert that behavior
> possibly reusing the fixtures in electric-tests.el.

Yes.

> > The same bug occurs in Python Mode.
> > Succinctly, the bug is that on pressing <CR> lots of times in a row, the
> > indentation WS is being left on the blank lines rather than being
> > removed.

> I see.  That does make sense. But, to be sure, we _dont_ what to
> remove the indentation WS on the "current" line, right?

Right.  Unless, and until, the current line becomes the "previous" line,
still otherwise being blank.

I think we're agreed on everything.  :-)

> João

-- 
Alan Mackenzie (Nuremberg, Germany).





reply via email to

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