emacs-devel
[Top][All Lists]
Advanced

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

Re: master 99c637499e: Only apply last change to the clipboard


From: Eli Zaretskii
Subject: Re: master 99c637499e: Only apply last change to the clipboard
Date: Wed, 02 Feb 2022 16:44:16 +0200

> From: Po Lu <luangruo@yahoo.com>
> Cc: monnier@iro.umontreal.ca,  emacs-devel@gnu.org
> Date: Wed, 02 Feb 2022 21:51:26 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> Hmm, that means the result is not useful for `gui-selection-value'.
> >> Would there be a way to implement that feature on MS-Windows?
> >> 
> >> The simplest way to implement it would be to return `t' if Emacs stored
> >> the text currently in the clipboard.
> 
> > What would be the purpose of that?  What would you like to do with
> > "ownership" of the clipboard data, and why?
> 
> That way, `gui-selection-value' can return nil if Emacs owns the
> selection (per the doc string of `interprogram-paste-function') to avoid
> fetching the selection in the common case where the user is yanking text
> saved by Emacs.

But the Windows implementation of gui-selection-value already does
that.  Did you try it on Windows?

> > Emacs on Windows already tries internally to keep track of whether the
> > stuff in the clipboard was put there by the current session, so I'm
> > not sure why else would you need this.
> 
> See the doc string of `interprogram-paste-function':
> 
>   If no other program has provided text to paste, the function should
>   return nil (in which case the caller, usually current-kill, should use
>   the top of the Emacs kill ring)

The Windows build already lives up to that promise.  There's no need
for any additional code.



reply via email to

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