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: Mon, 25 Jan 2021 10:15:03 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> The problem with `whitespace-cleanup-mode` is that it's global.
>> I'd like something that only operates locally, i.e. only touches lines
>> you've modified.
> That would be https://github.com/lewang/ws-butler.

That's better, indeed, tho if you look at the implementation you see
that it has to deal with lots of corner cases, so it ends up "ugly and
brittle": I'm not sure "cleanup on save" is the better option.
I don't mean to say that Le Wang did a bad job, BTW: the issues aren't
caused by a bad design or implementation, but by a hard problem.

I was thinking instead of something that removes the trailing space(s)
when point leaves the line (like Madhu suggested).  Of course that's
also fraught with danger (e.g. you don't want that whitespace to
disappear just because you did `C-x C-x`), so the result might end up
just as ugly&brittle.

> whitespace-cleanup-mode is working out just fine for me, though, because by
> default is only cleans files that were clean previously.

I'd like a feature that is also active in non-clean files.


        Stefan




reply via email to

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