GNU bug report logs -
#79371
[PATCH] Make yank-in-context also can indent the yanked text.
Previous Next
Full log
View this message in rfc822 format
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.