Subject: 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.

From: James Thomas <[email-masked]>
Date: Mon, 11 Aug 2025 19:34:57 +0530

The last one, I promise (whether right or wrong):

diff --git a/lisp/simple.el b/lisp/simple.el
index cd13e0a55f4..415aea6874c 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)))))
 
 ;; 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,7 @@ yank
   (push-mark)
   (insert-for-yank (current-kill (cond
 				  ((listp arg) 0)
-				  ((eq arg '-) -1)
+				  ((eq arg '-) (1- (length kill-ring-yank-pointer)))
 				  (t (1- arg)))))
   (if (consp arg)
       ;; This is like exchange-point-and-mark, but doesn't activate the mark.

--