GNU bug report logs - #79371
[PATCH] Make yank-in-context also can indent the yanked text.

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Tue, 2 Sep 2025 15:57:02 UTC

Severity: normal

Tags: patch

Full log


Message #38 received at 79371 <at> debbugs.gnu.org (full text, mbox):

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 79371 <at> debbugs.gnu.org
Subject: Re: bug#79371: [PATCH] Make yank-in-context also can indent the
 yanked text.
Date: Thu, 04 Sep 2025 19:45:20 -0600
Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

>> Fine, I'll see how to implement it in electric-indent.

> I'm not sure that's such a good idea.
>
> At some point I did consider implementing `electric-indent` in
> a different way, which would automatically cover things like `yank`, but
> in the end electric-indent is fairly "conservative" in terms of when it
> reindents.

Probably this should be an additional and optional feature for
electric-indent e.g. only indent a region when some command has been
called.

This could extend it to other things, e.g. indent the buffer on save.

> If you're careful to place an undo boundary before doing the
> `indent-region`, it ends up being a choice between:
>
> - Don't reindent by default, let user hit `C-M-\` if they want to reindent.
> - Reindent by default, let user hit `C-/` if they didn't want to reindent.
>
> IOW, I'm rather favorable to your proposition.  It seems worth a try.
> Tho, maybe you want to pay attention to
>
>     (or (memq indent-line-function
>               electric-indent-functions-without-reindent)
>         electric-indent-inhibit)
>
> so as not to call `indent-region` when that function is unlikely to do
> a good job.

Thanks, I'll keep that in mind.

-- 
- E.G via Gnus and Org.




This bug report was last modified 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.