From: Juri Linkov Date: Thu, 3 Jun 2021 20:54:30 +0000 (+0300) Subject: * lisp/simple.el (read-from-kill-ring): Fix the case of 'M-y M-p' (bug#48478) X-Git-Tag: emacs-28.0.90~2200 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=15c57fc4cc031cc6aca7eabd74706538fd6bfa22;p=emacs.git * lisp/simple.el (read-from-kill-ring): Fix the case of 'M-y M-p' (bug#48478) Don't use offsets for read-from-kill-ring-history when kill-ring-yank-pointer points to the last element of kill-ring. --- diff --git a/lisp/simple.el b/lisp/simple.el index 6d216f74d91..a0adaff431e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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