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 23:20:04 +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.
>
> Then maybe this is another reason to prefer adding the edited string
> to the kill-ring?  In which case you will need to reset the pointer to
> the head of the ring?

When there is a need to add the edited string to the kill-ring,
then better to do this explicitly by marking the whole contents of
the edited minibuffer with 'C-x h', then adding it to the kill-ring
with 'M-w'.

>> >> 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.
>
> If this is the scenario, then I don't see a problem: what you describe
> works for me, i.e. "M-y M-p" does insert the last killed item into the
> minibuffer.  I wonder why it doesn't work for you.

I tried in 'emacs -Q', and 'M-y M-p' doesn't insert the last killed item
into the minibuffer.





reply via email to

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