GNU bug report logs - #79197
[PATCH] ; * lisp/simple.el (yank): Update docstring.

Previous Next

Package: emacs;

Reported by: James Thomas <jimjoe <at> gmx.net>

Date: Thu, 7 Aug 2025 21:23:01 UTC

Severity: normal

Tags: patch

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: James Thomas <jimjoe <at> gmx.net>
Cc: 79197 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#79197: [PATCH] ; * lisp/simple.el (yank): Update
 docstring., Re: bug#79197: [PATCH] ; * lisp/simple.el (yank): Update
 docstring., Re: bug#79197: [PATCH] ; * lisp/simple.el (yank): Update
 docstring.
Date: Mon, 11 Aug 2025 16:49:03 +0300
> From: James Thomas <jimjoe <at> gmx.net>
> Cc: 79197 <at> debbugs.gnu.org,  monnier <at> iro.umontreal.ca
> Date: Mon, 11 Aug 2025 18:37:38 +0530
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > OK, so given these observations, how do you propose to continue?  Do
> > you have a patch to propose, either for the doc string or for the code
> > or both? if so, please show the patch, and let's take it from there.
> 
> 
> diff --git a/lisp/simple.el b/lisp/simple.el
> index cd13e0a55f4..97701ead69d 100644
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -5758,9 +5758,10 @@ kill-new
>  	  (setcar kill-ring string)
>          (let ((history-delete-duplicates nil))
>            (add-to-history 'kill-ring string kill-ring-max t))))
> -    (setq kill-ring-yank-pointer kill-ring)
> +    (prog1
> +        (setq kill-ring-yank-pointer kill-ring)
>      (if interprogram-cut-function
> -        (funcall interprogram-cut-function string))))
> +        (funcall interprogram-cut-function string)))))

Why do we need this hunk?

>  ;; It has been argued that this should work like `self-insert-command'
>  ;; which merges insertions in `buffer-undo-list' in groups of 20
> @@ -6399,7 +6400,8 @@ yank
>    (push-mark)
>    (insert-for-yank (current-kill (cond
>  				  ((listp arg) 0)
> -				  ((eq arg '-) -1)
> +				  ((eq arg '-) (- (length kill-ring)
> +                                                  (length kill-ring-yank-pointer)))
>  				  (t (1- arg)))))

So, once again "C-u -" and "C-u - 1" will produce different results?

And what about documenting the effect of a negative arg?

Thanks.

P.S. The change in behavior for negative arguments might need to be
called out in NEWS, in case someone had that in their muscle memory
for some reason.




This bug report was last modified 3 days ago.

Previous Next


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