]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/simple.el (read-from-kill-ring): Fix the case of 'M-y M-p' (bug#48478)
authorJuri Linkov <juri@linkov.net>
Thu, 3 Jun 2021 20:54:30 +0000 (23:54 +0300)
committerJuri Linkov <juri@linkov.net>
Thu, 3 Jun 2021 20:54:30 +0000 (23:54 +0300)
Don't use offsets for read-from-kill-ring-history when kill-ring-yank-pointer
points to the last element of kill-ring.

lisp/simple.el

index 6d216f74d918470fcbeb0ca44368083dfed3d1f3..a0adaff431e5ca9ba0de70cd3f5d66c8786e0f61 100644 (file)
@@ -5742,7 +5742,8 @@ 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 (1+ history-pos))
+           (cons 'read-from-kill-ring-history
+                 (if (zerop history-pos) history-pos (1+ history-pos)))
          'read-from-kill-ring-history)))))
 
 (defcustom yank-from-kill-ring-rotate t