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: Mon, 31 May 2021 01:32:15 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> When read-from-kill-ring returns an edited string,
>> how yank-from-kill-ring could use it to adjust kill-ring-yank-pointer?
>
> read-from-kill-ring could store the pointer in some variable, I guess?

There is no way to get the pointer to point to the entry of the kill ring,
because we can't find the edited string in the kill ring.

>> > 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?
>
> It depends on whether we add the edited string to the kill ring or
> not.  Currently, we don't add it, so I think the value should be that
> of the unedited entry in the kill ring.

The minibuffer returns only the edited entry that
we can't use to find the unedited entry in the kill ring.

>> 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
>
> Sorry, I don't understand how does minibiffer enter the picture.  Can
> you show a complete recipe?

M-y activates the minibuffer and uses its (HISTVAR . HISTPOS)
to set the initial position for use by the minibuffer history
to the entry pointed by kill-ring-yank-pointer.  So this is similar
to what C-y does when it yanks the same entry pointed by kill-ring-yank-pointer.





reply via email to

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