From: Juri Linkov Date: Fri, 21 May 2021 18:18:09 +0000 (+0300) Subject: * lisp/simple.el (yank-from-kill-ring): Fix kill-ring-yank-pointer (bug#48478) X-Git-Tag: emacs-28.0.90~2367 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dfe79a8185bb1374e09096f81aba865adb33359f;p=emacs.git * lisp/simple.el (yank-from-kill-ring): Fix kill-ring-yank-pointer (bug#48478) --- diff --git a/lisp/simple.el b/lisp/simple.el index f139555dd34..2a90a076315 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5772,9 +5772,8 @@ When called from Lisp, insert STRING like `insert-for-yank' does." (insert-for-yank string) (when yank-from-kill-ring-rotate (let ((pos (seq-position kill-ring string))) - (setq kill-ring-yank-pointer - (or (and pos (nthcdr pos kill-ring)) - kill-ring)))) + (when pos + (setq kill-ring-yank-pointer (nthcdr pos kill-ring))))) (if (consp arg) ;; Swap point and mark like in `yank' and `yank-pop'. (goto-char (prog1 (mark t)