From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: master 99c637499e: Only apply last change to the clipboard
Date: Wed, 02 Feb 2022 16:44:16 +0200 [thread overview]
Message-ID: <834k5h72gv.fsf@gnu.org> (raw)
In-Reply-To: <87zgn98jhd.fsf@yahoo.com> (message from Po Lu on Wed, 02 Feb 2022 21:51:26 +0800)
> 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.
next prev parent reply other threads:[~2022-02-02 14:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <164368163944.24305.8528536193885928245@vcs2.savannah.gnu.org>
[not found] ` <20220201021359.C439EC40717@vcs2.savannah.gnu.org>
2022-02-01 5:20 ` master 99c637499e: Only apply last change to the clipboard Stefan Monnier
2022-02-01 5:24 ` Po Lu
2022-02-01 5:28 ` Po Lu
2022-02-01 14:59 ` Eli Zaretskii
2022-02-02 0:58 ` Po Lu
2022-02-02 3:32 ` Eli Zaretskii
2022-02-02 4:50 ` Po Lu
2022-02-02 12:49 ` Eli Zaretskii
2022-02-02 13:51 ` Po Lu
2022-02-02 14:44 ` Eli Zaretskii [this message]
2022-02-03 1:11 ` Po Lu
2022-02-03 4:01 ` Stefan Monnier
2022-02-03 7:48 ` Eli Zaretskii
2022-02-03 13:32 ` Stefan Monnier
2022-02-01 5:35 ` Stefan Monnier
2022-02-01 7:40 ` Po Lu
2022-02-01 13:41 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=834k5h72gv.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.com \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).