emacs-devel
[Top][All Lists]
Advanced

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

Re: newline-and-indent vs. electric-indent-mode


From: Stefan Monnier
Subject: Re: newline-and-indent vs. electric-indent-mode
Date: Fri, 22 Jan 2021 18:16:48 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>> That would disable the effects of electric-indent-functions, and in
>>> particular, of ruby--electric-indent-p.
>> I don't see why.  AFAIK it should only inhibit the "reindent original
>> line when inserting \n".  It should affect indentation of the line after
>> the inserted \n nor should it affect indentation when inserting
>> other chars.
> It also affect "reindent original line when inserting something other than
> \n", which is what ruby--electric-indent-p is all about (e.g. I type 'd'
> finishing the token 'end', and the line is reindented).

Hmm... indeed I now see that the code also inhibits reindentation in
that case.  Weird!
Could you open a bug report for this?

> It's just that in my mental model \n doesn't belong to the current line,
> only to the next one. So it shouldn't reindent the original line.

It's often useful for me, as in typing

    foo RET else RET blabla

where the else benefits from being reindented upon the second RET.


        Stefan




reply via email to

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