emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ef7a6ee: Fix off-by-one inconsistency of 'M-y C-y' (bug#48478).


From: Juri Linkov
Subject: master ef7a6ee: Fix off-by-one inconsistency of 'M-y C-y' (bug#48478).
Date: Thu, 20 May 2021 14:02:39 -0400 (EDT)

branch: master
commit ef7a6eec20a59b338e18aea4f8a805dcfc8dfc96
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    Fix off-by-one inconsistency of 'M-y C-y' (bug#48478).
    
    * lisp/simple.el (read-from-kill-ring): Increment kill-ring-yank-pointer by 
1.
    (yank-from-kill-ring): Don't increment kill-ring-yank-pointer by 1.
---
 lisp/simple.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 5e31723..f139555 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5734,7 +5734,7 @@ PROMPT is a string to prompt with."
            (complete-with-action action completions string pred)))
        nil nil nil
        (if history-pos
-           (cons 'read-from-kill-ring-history history-pos)
+           (cons 'read-from-kill-ring-history (1+ history-pos))
          'read-from-kill-ring-history)))))
 
 (defcustom yank-from-kill-ring-rotate t
@@ -5773,7 +5773,7 @@ When called from Lisp, insert STRING like 
`insert-for-yank' does."
   (when yank-from-kill-ring-rotate
     (let ((pos (seq-position kill-ring string)))
       (setq kill-ring-yank-pointer
-            (or (and pos (nthcdr (1+ pos) kill-ring))
+            (or (and pos (nthcdr pos kill-ring))
                 kill-ring))))
   (if (consp arg)
       ;; Swap point and mark like in `yank' and `yank-pop'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]