From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 99c637499e: Only apply last change to the clipboard Date: Wed, 02 Feb 2022 16:44:16 +0200 Message-ID: <834k5h72gv.fsf@gnu.org> References: <164368163944.24305.8528536193885928245@vcs2.savannah.gnu.org> <20220201021359.C439EC40717@vcs2.savannah.gnu.org> <8735l3cg7b.fsf@yahoo.com> <87y22vb1ft.fsf@yahoo.com> <83y22u7hui.fsf@gnu.org> <87h79iaxu2.fsf@yahoo.com> <83ilty6izh.fsf@gnu.org> <87sft1an3o.fsf@yahoo.com> <83bkzp77sw.fsf@gnu.org> <87zgn98jhd.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9256"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 02 17:49:33 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFIp2-0002GE-KW for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Feb 2022 17:49:32 +0100 Original-Received: from localhost ([::1]:35986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFIp1-0005f0-1Q for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Feb 2022 11:49:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFGrr-0001Gz-F9 for emacs-devel@gnu.org; Wed, 02 Feb 2022 09:44:19 -0500 Original-Received: from [2001:470:142:3::e] (port=34628 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFGrn-0001DJ-Ht; Wed, 02 Feb 2022 09:44:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=CE4SHPRbM3g+Anp08HKERjlr0CQk7/Qg1lLPFCqAMOQ=; b=PmDWMMLaGDgD 68+LCMtAbIIdvEc+dNqEx4jZghwf3TC/LR9ukYtUTeq833+M7rqtdoY+wA3GeqkJcuMfqomeXHBM+ ldxoIHrJkA0jFLVicuFk6Km1t5IIMMCMMpvzu9bNTrr23uT9Qs/6ELvdHK0vK7MLLXqJ1DR4DoL2i mS6Mz3jMa8DO7IpbiTJrxX6huZD/bm72xj16/PwTkJ25iFUOzaMXmM3oX9wq1TP2thbgKNAtpuW9P 0hi0fFriYllhoSm50V28Wv9hymWR4AgHK9Ix01s/idWDxAcOnyPEP98TP6ChPVreSVa2JYWJbXF6C zOpZrP6VDt7UqIxP58GYbQ==; Original-Received: from [87.69.77.57] (port=3660 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFGrl-00048G-Tb; Wed, 02 Feb 2022 09:44:14 -0500 In-Reply-To: <87zgn98jhd.fsf@yahoo.com> (message from Po Lu on Wed, 02 Feb 2022 21:51:26 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:285794 Archived-At: > From: Po Lu > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Wed, 02 Feb 2022 21:51:26 +0800 > > Eli Zaretskii 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.