|
From: | Dmitry Gutov |
Subject: | Re: newline-and-indent vs. electric-indent-mode |
Date: | Mon, 25 Jan 2021 13:59:35 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 25.01.2021 12:45, Madhu wrote:
* Dmitry Gutov <801ef866-4212-5b74-350e-9942953174fe@yandex.ru> : Wrote on Mon, 25 Jan 2021 04:29:55 +0200:On 25.01.2021 03:56, Madhu wrote:I used to be benefit from emacs indentation by binding RET to newline-and-indent and remain in control of indentation.How was it different? newline-and-indent can lead to "spurious whitespace" just the same.This is true now, and I'm not able to say with certainty what the difference was 10 years ago (if it indeed was different)
It wasn't different before electric-indent-mode was introduced.
IIRC the way to deal with it was that if the next event after a newline-and-indent is *not* a self-insert-command, then empty whitespace on that line should have be cleaned up.
I've always had to use a third-party mode to clean up that whitespace, such as https://github.com/purcell/whitespace-cleanup-mode (most recently).
But what you're suggesting should be easy enough to implement in your personal config too, creating a wrapper for newline-and-indent.
[Prev in Thread] | Current Thread | [Next in Thread] |