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 #11 received at 79371 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Elijah Gabe Pérez <eg642616 <at> gmail.com>
Cc: 79371 <at> debbugs.gnu.org
Subject: Re: bug#79371: [PATCH] Make yank-in-context also can indent the
 yanked text.
Date: Tue, 02 Sep 2025 12:55:23 -0400
> This patch makes `yank-in-context` can optionally indent the yanked text.
[...]
> @@ -6432,8 +6452,12 @@ yank-in-context
>  variable to determine how strings should be escaped."
>    (interactive "*P")
>    (let ((yank-transform-functions (cons #'yank-in-context--transform
> -                                        yank-transform-functions)))
> -    (yank arg)))
> +                                        yank-transform-functions))
> +        (beg (point)) end)
> +    (yank arg)
> +    (setq end (point))
> +    (if yank-in-context-indent
> +        (funcall yank-in-context-indent-function beg end))))

Hmm... what's the intended use case?

`yank-in-context` differs from `yank` only inside strings and comments,
but in most major modes `indent-region` doesn't know how to indent
inside strings and comments because we don't know if it holds plain text
or code or whatnot.


        Stefan





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.