bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#48478: 28.0.50; yank-from-kill-ring and kill-ring-yank-pointer


From: Juri Linkov
Subject: bug#48478: 28.0.50; yank-from-kill-ring and kill-ring-yank-pointer
Date: Thu, 27 May 2021 01:09:33 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> > If you want yank-from-kill-ring to leave kill-ring-yank-pointer
>> > unaltered, we could move the pointer in yank-pop, after
>> > yank-from-kill-ring returns.  WDYT?
>>
>> When yank-from-kill-ring returns an edited string,
>
> When does it do that?  AFAICT, it _inserts_ the edited string.

Sorry, I meant this:

When read-from-kill-ring returns an edited string,
how yank-from-kill-ring could use it to adjust kill-ring-yank-pointer?

> yank-from-kill-ring is a new function, and its return value isn't
> documented.  So you could change it to return kill-ring-yank-pointer
> instead, and then yank-pop could move it.

I don't understand what value of kill-ring-yank-pointer
should be returned: its old value or some modified value?

BTW, the recent fix in ef7a6eec20 broke such use case:
M-w on some region, but then M-y M-p doesn't insert the last item
to the minibuffer, i.e. the same item that is inserted to the buffer
by C-y.  Here is a workaround:

diff --git a/lisp/simple.el b/lisp/simple.el
index 0d4a712b39..7014f1c24c 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5735,7 +5736,8 @@ read-from-kill-ring
            (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)))))






reply via email to

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