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

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

bug#27442: Un-obsolete x-clipboard-yank, or provide analogous functional


From: Stefan Monnier
Subject: bug#27442: Un-obsolete x-clipboard-yank, or provide analogous functional
Date: Mon, 05 Jul 2021 10:46:12 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> (defun gui-selection-value ()
>   (let ((clip-text
>          (when select-enable-clipboard
>            (let ((text (gui--selection-value-internal 'CLIPBOARD)))
>              (if (string= text "") (setq text nil))
>
>              ;; Check the CLIPBOARD selection for 'newness', is it different
>              ;; from what we remembered them to be last time we did a
>              ;; cut/paste operation.
>              (prog1
>                  (unless (equal text gui--last-selected-text-clipboard)
>                    text)
>                (setq gui--last-selected-text-clipboard text)))))
>
> So, indeed, if you `M-x clipboard-yank', then kill some text in Emacs,
> you can't `M-x clipboard-yank' until you've clipboarded some other text,
> yanked it, and then clipboarded the original text again.
>
> Fixing this should be pretty trivial -- the following patch should do
> the trick, I think (although I haven't tested it).  But I'm not quite
> sure about the intended logic here, so I've added Stefan M to the CCs --
> perhaps he has some comments.

AFAIK this part of the clipboard interaction is one I just preserved
from earlier code when I did my "gui-selection" rework.
I "just preserved" it because I don't really understand how it's
intended to work, nor do I understand enough of the design constraints
to be able to come up with my own design of how it should work :-(

Your patch looks acceptable to me (it is also disappointing because
it doesn't really help understand how this thing is intended to work,
but it follows the same principles as the ones I followed).


        Stefan






reply via email to

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