diff options
| author | Juri Linkov | 2021-05-20 21:02:27 +0300 |
|---|---|---|
| committer | Juri Linkov | 2021-05-20 21:02:27 +0300 |
| commit | ef7a6eec20a59b338e18aea4f8a805dcfc8dfc96 (patch) | |
| tree | fd38e84182c0065fd4484587653769e634c5a229 | |
| parent | 1866e66a73083fa5466b040d2cc44ca73da891e9 (diff) | |
| download | emacs-ef7a6eec20a59b338e18aea4f8a805dcfc8dfc96.tar.gz emacs-ef7a6eec20a59b338e18aea4f8a805dcfc8dfc96.zip | |
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.
| -rw-r--r-- | lisp/simple.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 5e3172326f9..f139555dd34 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -5734,7 +5734,7 @@ PROMPT is a string to prompt with." | |||
| 5734 | (complete-with-action action completions string pred))) | 5734 | (complete-with-action action completions string pred))) |
| 5735 | nil nil nil | 5735 | nil nil nil |
| 5736 | (if history-pos | 5736 | (if history-pos |
| 5737 | (cons 'read-from-kill-ring-history history-pos) | 5737 | (cons 'read-from-kill-ring-history (1+ history-pos)) |
| 5738 | 'read-from-kill-ring-history))))) | 5738 | 'read-from-kill-ring-history))))) |
| 5739 | 5739 | ||
| 5740 | (defcustom yank-from-kill-ring-rotate t | 5740 | (defcustom yank-from-kill-ring-rotate t |
| @@ -5773,7 +5773,7 @@ When called from Lisp, insert STRING like `insert-for-yank' does." | |||
| 5773 | (when yank-from-kill-ring-rotate | 5773 | (when yank-from-kill-ring-rotate |
| 5774 | (let ((pos (seq-position kill-ring string))) | 5774 | (let ((pos (seq-position kill-ring string))) |
| 5775 | (setq kill-ring-yank-pointer | 5775 | (setq kill-ring-yank-pointer |
| 5776 | (or (and pos (nthcdr (1+ pos) kill-ring)) | 5776 | (or (and pos (nthcdr pos kill-ring)) |
| 5777 | kill-ring)))) | 5777 | kill-ring)))) |
| 5778 | (if (consp arg) | 5778 | (if (consp arg) |
| 5779 | ;; Swap point and mark like in `yank' and `yank-pop'. | 5779 | ;; Swap point and mark like in `yank' and `yank-pop'. |