From: Dmitry Gutov <dgutov@yandex.ru>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Madhu <enometh@meer.net>, emacs-devel@gnu.org
Subject: Re: newline-and-indent vs. electric-indent-mode
Date: Tue, 26 Jan 2021 04:04:32 +0200 [thread overview]
Message-ID: <452e56da-a92e-bb19-54d9-faabff2b7c2d@yandex.ru> (raw)
In-Reply-To: <jwvy2ghjbwc.fsf-monnier+emacs@gnu.org>
On 25.01.2021 17:15, Stefan Monnier wrote:
>>> 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.
Indeed, there are a lot of hooks involved, but it seemed to work last
time I tried it.
> 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.
Or if I just did C-n C-p, or something more complex to the same effect.
But I suppose somebody could try creating a prototype, and then we'd see
just how jarring this approach is (or not).
Alternatively, one could start with looking into how others editors do it.
>> 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.
I just clean such a file manually once, and then the feature is active.
Or I don't, and use whitespace-mode to make sure I don't leave new
trailing whitespace around.
Files like that are a minority in my experience, so it's not too big a
price to pay for being able to rely on a simple implementation. YMMV, of
course.
next prev parent reply other threads:[~2021-01-26 2:04 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-22 13:53 newline-and-indent vs. electric-indent-mode Harald Jörg
2021-01-22 14:49 ` Stefan Monnier
2021-01-22 15:02 ` Dmitry Gutov
2021-01-22 15:09 ` Stefan Monnier
2021-01-22 22:43 ` Dmitry Gutov
2021-01-22 22:56 ` Stefan Monnier
2021-01-22 23:00 ` Dmitry Gutov
2021-01-22 23:16 ` Stefan Monnier
2021-01-23 0:45 ` Dmitry Gutov
2021-01-23 3:16 ` Stefan Monnier
2021-01-24 2:54 ` Dmitry Gutov
2021-01-24 5:29 ` Stefan Monnier
2021-01-24 21:45 ` Dmitry Gutov
2021-01-25 1:56 ` Madhu
2021-01-25 2:29 ` Dmitry Gutov
2021-01-25 10:45 ` Madhu
2021-01-25 11:59 ` Dmitry Gutov
2021-01-25 14:36 ` Stefan Monnier
2021-01-25 14:42 ` Dmitry Gutov
2021-01-25 15:15 ` Stefan Monnier
2021-01-25 20:10 ` Rudolf Schlatte
2021-01-26 2:04 ` Dmitry Gutov [this message]
2021-01-26 2:43 ` Stefan Monnier
2021-01-26 15:58 ` martin rudalics
2021-01-25 3:33 ` Eli Zaretskii
2021-01-22 19:33 ` Harald Jörg
2021-01-22 22:05 ` Stefan Monnier
2021-01-23 2:19 ` Harald Jörg
2021-01-23 3:29 ` Stefan Monnier
2021-01-23 16:27 ` Harald Jörg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=452e56da-a92e-bb19-54d9-faabff2b7c2d@yandex.ru \
--to=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=enometh@meer.net \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.