From unknown Mon Jun 23 09:41:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31209: 27.0.50; current-kill calls interprogram-paste-function more than once Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 17:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31209 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 31209@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.152407364213731 (code B ref -1); Wed, 18 Apr 2018 17:48:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Apr 2018 17:47:22 +0000 Received: from localhost ([127.0.0.1]:59535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8rAw-0003ZP-CJ for submit@debbugs.gnu.org; Wed, 18 Apr 2018 13:47:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41357) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8rAu-0003ZC-WF for submit@debbugs.gnu.org; Wed, 18 Apr 2018 13:47:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8rAo-0002QM-Jj for submit@debbugs.gnu.org; Wed, 18 Apr 2018 13:47:15 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59056) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f8rAo-0002PT-En for submit@debbugs.gnu.org; Wed, 18 Apr 2018 13:47:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8rAn-0001ZH-02 for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 13:47:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8rAj-0002Ja-Tc for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 13:47:13 -0400 Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]:40283) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f8rAj-0002H0-Lg for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 13:47:09 -0400 Received: by mail-wr0-x230.google.com with SMTP id v60-v6so7061652wrc.7 for ; Wed, 18 Apr 2018 10:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:mail-followup-to:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=+HIRTFe99k2qGvh0XR3mo3NaPUp35mWmlCrFPdaPOLY=; b=Zwd0ENgqYh6XcEGR/XhbZQBwBYgBCkutn1dsClK2jPYuSJANy2Tm3ObNYx8OpjHO91 JyPGXYKdp2WPDng7u1fFfUb57tf3b0LZJOOu46xk9iyiWgl2JmJChjwxS0ZUoFDtJcL8 px9eeuBPI+7OyXnYulZ5hk3CnvAWdlkQPI9fA0Pm/keA605ucEKP/t0Kq4jA4VJo+hTv 1BlXDpK+cOriogku1wa/uthNl93Uf31IKxQp3sYdJduK7I5Zk23C2rKY71JJSYOU/BUA nDC49G/TSY525b7iTlFDZJ+BCumZB1pTWYUvlkT31y4kQbh+fuV/z+HRECveIDaDN+uo BYSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:mail-followup-to:date:message-id :user-agent:mime-version:content-transfer-encoding; bh=+HIRTFe99k2qGvh0XR3mo3NaPUp35mWmlCrFPdaPOLY=; b=nIck6sVQVYg6jd/K7mJ7ZMd/jh79PthdPbe6wPCVjYAyPb6svA/o8Yagzj+aUVgUgx V0qpitOLqDuyil95WiR8Ujaz6c/ksZv5fKmjfw+MBJYkOV1wJqCct7OuEpy9FOkFUxZb roBQnXhii89SgqgAG+ZI9SsVgFfbZaBnZC6p3bIVzpYnSesPW3hKFdtLYz3gviS5MnHp gA9rDUOLRMYUCsdjDYb/BblnNuQ1Zje5zYcTK9FrshbR8jtI08csH04yTyCHcHnybZ7p zhavyW/rPLGufooL2ts9zP9m9tQGYCRpaulJbvRzg4BXoJyyNFFnEw8okEmSZ9SULilz 0EcA== X-Gm-Message-State: ALQs6tB00L6CBO3OaRidrK7g66XGT7KJkTAni28JqoD9WPPFMqFdPUVs abuXugai4Z8XyTvl+1O4YBPnARae X-Google-Smtp-Source: AIpwx48C9E5eJ9aZho2tpKBwcLueyXEUWMe+m9i8q3Yz+W5kkxmYMm60zd9xbqLn7QqdqtTPYLdDAw== X-Received: by 10.80.167.101 with SMTP id h92mr4512684edc.218.1524073627280; Wed, 18 Apr 2018 10:47:07 -0700 (PDT) Received: from localhost ([213.233.149.19]) by smtp.gmail.com with ESMTPSA id a16sm1316732edd.28.2018.04.18.10.47.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Apr 2018 10:47:06 -0700 (PDT) From: "Basil L. Contovounesios" Mail-Followup-To: bug-gnu-emacs@gnu.org Date: Wed, 18 Apr 2018 18:47:04 +0100 Message-ID: <877ep42yqv.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Under lexical-binding, I expect the following: (let* ((i 0) (kill-ring ()) (kill-ring-yank-pointer ()) (save-interprogram-paste-before-kill t) (interprogram-paste-function (lambda () (setq i (1+ i)) (list "a" "b" "c")))) (current-kill 0) (message "\ `interprogram-paste-function' called %d time(s) `kill-ring' =3D %s" i kill-ring)) to evaluate to: =E2=80=98interprogram-paste-function=E2=80=99 called 1 time(s) =E2=80=98kill-ring=E2=80=99 =3D (a b c) but the actual result is: =E2=80=98interprogram-paste-function=E2=80=99 called 4 time(s) =E2=80=98kill-ring=E2=80=99 =3D (a a b c b a b c c a b c) This behaviour is due to current-kill passing each string returned by interprogram-paste-function to kill-new, which in turn calls interprogram-paste-function when save-interprogram-paste-before-kill is non-nil, and was introduced along with save-interprogram-paste-before-kill [1: 4ed8c7aadb]. [1: 4ed8c7aadb]: 2009-08-26 20:55:39 +0000 (save-interprogram-paste-before-kill): New user option. https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3D4ed8c7aadb59c8ae= 75641710e3d9ff5bddbbd952 Patch addressing this to follow. Thanks, --=20 Basil In GNU Emacs 27.0.50 (build 6, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll= bars) of 2018-04-18 built on thunk Repository revision: 5dff4905d73d0d42447ff4b114d1af726a689c6a Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Debian GNU/Linux buster/sid From unknown Mon Jun 23 09:41:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31209: 27.0.50; current-kill calls interprogram-paste-function more than once Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 17:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31209 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: <31209@debbugs.gnu.org> Received: via spool by 31209-submit@debbugs.gnu.org id=B31209.152407395014174 (code B ref 31209); Wed, 18 Apr 2018 17:53:02 +0000 Received: (at 31209) by debbugs.gnu.org; 18 Apr 2018 17:52:30 +0000 Received: from localhost ([127.0.0.1]:59540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8rFt-0003gY-WC for submit@debbugs.gnu.org; Wed, 18 Apr 2018 13:52:30 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:35507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8rFr-0003gK-LB for 31209@debbugs.gnu.org; Wed, 18 Apr 2018 13:52:28 -0400 Received: by mail-wr0-f182.google.com with SMTP id w3-v6so7117196wrg.2 for <31209@debbugs.gnu.org>; Wed, 18 Apr 2018 10:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:references:mail-followup-to:date:in-reply-to :message-id:user-agent:mime-version; bh=gAMR/fF13S7vY25Q81TkY2qRNYInyqWluoStOeXNCeo=; b=N4Fcc2+w3LQTSshR1sMJOkKxYZ6bDmsq2mXT4vCk9x1fzKA7qpTpWoUFcBItd+vEt2 zCON9Zfc1lj7z/pwKw0RzF2C93pg01e37PR9/7hlqMNrrpfL9MVOhBdMCsckNU4NvLQ+ zsohkUQEWwWslVQ6ztOuOE0pOze7b0Cp58we9x9/ZrUgoKhju1VnlC+mRwagUGzNGP6p 8BRcDIUjk0peI9X2Ir12J/z285u/1i+m4+YqS5/U1VHxs2cnytOLmzA4JshqVA0y02Y2 rD2KtE7nzq91Vo/VM1GqbMTwEUvPhS/WToV1tbFOa+a8am7tsbi1legQMnKunPGU/nzj x2uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:mail-followup-to:date :in-reply-to:message-id:user-agent:mime-version; bh=gAMR/fF13S7vY25Q81TkY2qRNYInyqWluoStOeXNCeo=; b=W2slevcHOpnnza3z9X8Ev5LuhBMWJizC177lwXGUsYPuP1KMe/lzMDRribhI8rZr00 kV4B+2C0y5rgNiXh49izIPhdxF85rlAauxE+VVE9MRtNwr7cEQvFhJe6nct+pjSCOfuk RSYtELBzAwueJeNwW/SjjvCsMf2291R71IoLhPASJYXOBS78hS2vWleGm3yiKLHrgBjc z4b9CDSjDkPo+46l0Aj9ow1NmTPa2JO4zoV2vL5owEe+ZYiwMuJxWooFdaqW7p1LX4vd eXoeyk6By4WO5kxsMRH1jZ1GBlsRvvnfgyc9Q+SttcU/3RUqtfS9G6mupQTuQ1NGJ0FI qlhw== X-Gm-Message-State: ALQs6tDWI70khhogcuIirxuqfAtC/uhG2BUnI9Nz8YGLvHjvXaUAAPd9 Bel96LNJuzrtI7ul6IEccTF3Dc5x X-Google-Smtp-Source: AIpwx4914hVZ0CNe4WwUCdQ6bWC6TbTJSa/Yb4wMNBad+YsnGz6E0Dk4dxyOvN0o3p/fHELtSBlkVw== X-Received: by 10.80.142.131 with SMTP id w3mr4467363edw.140.1524073941289; Wed, 18 Apr 2018 10:52:21 -0700 (PDT) Received: from localhost ([213.233.149.19]) by smtp.gmail.com with ESMTPSA id v40sm1215708edm.35.2018.04.18.10.52.20 for <31209@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Apr 2018 10:52:20 -0700 (PDT) From: "Basil L. Contovounesios" References: <877ep42yqv.fsf@tcd.ie> Mail-Followup-To: <31209@debbugs.gnu.org> Date: Wed, 18 Apr 2018 18:52:19 +0100 In-Reply-To: <877ep42yqv.fsf@tcd.ie> (Basil L. Contovounesios's message of "Wed, 18 Apr 2018 18:47:04 +0100") Message-ID: <8736zs2yi4.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Do-not-call-interprogram-paste-function-repeatedly.patch >From a82c662f645b82f6e9425160b586e8c607dd9a3e Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Thu, 12 Apr 2018 17:46:37 +0100 Subject: [PATCH 1/2] Do not call interprogram-paste-function repeatedly * lisp/simple.el (current-kill): Disable interprogram-paste-function so that kill-new doesn't call it repeatedly when save-interprogram-paste-before-kill is enabled. (bug#31209) --- lisp/simple.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index b51be3a8f8..15c4a92804 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4463,7 +4463,10 @@ current-kill ;; Disable the interprogram cut function when we add the new ;; text to the kill ring, so Emacs doesn't try to own the ;; selection, with identical text. - (let ((interprogram-cut-function nil)) + ;; Also disable the interprogram paste function, so that + ;; `kill-new' doesn't call it repeatedly. + (let ((interprogram-cut-function nil) + (interprogram-paste-function nil)) (if (listp interprogram-paste) ;; Use `reverse' to avoid modifying external data. (mapc #'kill-new (reverse interprogram-paste)) -- 2.17.0 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Improve-kill-related-documentation-bug-31209.patch >From 15d1a619039254df5ba1a43aa97e011bdb40175c Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 18 Apr 2018 18:35:38 +0100 Subject: [PATCH 2/2] Improve kill-related documentation (bug#31209) * doc/lispref/text.texi (Low-Level Kill Ring): Fix typo under current-kill. Mention interprogram-paste-function under kill-new and kill-append. * lisp/simple.el (save-interprogram-paste-before-kill, kill-new) (kill-append-merge-undo, kill-append): Touch-up docstrings. --- doc/lispref/text.texi | 14 +++++++++----- lisp/simple.el | 31 +++++++++++++++++-------------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 8cb6cf6242..da09b4ae1c 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -1143,7 +1143,7 @@ Low-Level Kill Ring @code{current-kill} calls the value of @code{interprogram-paste-function} (documented below) before consulting the kill ring. If that value is a function and calling it -returns a string or a list of several string, @code{current-kill} +returns a string or a list of several strings, @code{current-kill} pushes the strings onto the kill ring and returns the first string. It also sets the yanking pointer to point to the kill-ring entry of the first string returned by @code{interprogram-paste-function}, @@ -1156,8 +1156,10 @@ Low-Level Kill Ring @defun kill-new string &optional replace This function pushes the text @var{string} onto the kill ring and makes the yanking pointer point to it. It discards the oldest entry -if appropriate. It also invokes the value of -@code{interprogram-cut-function} (see below). +if appropriate. It also invokes the values of +@code{interprogram-paste-function} (subject to +the user option @code{save-interprogram-paste-before-kill}) +and @code{interprogram-cut-function} (see below). If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the first element of the kill ring with @var{string}, rather than pushing @@ -1169,8 +1171,10 @@ Low-Level Kill Ring kill ring and makes the yanking pointer point to the combined entry. Normally @var{string} goes at the end of the entry, but if @var{before-p} is non-@code{nil}, it goes at the beginning. This -function also invokes the value of @code{interprogram-cut-function} -(see below). +function calls @code{kill-new} as a subroutine, thus causing the +values of @code{interprogram-cut-function} and possibly +@code{interprogram-paste-function} (see below) to be invoked by +extension. @end defun @defvar interprogram-paste-function diff --git a/lisp/simple.el b/lisp/simple.el index 15c4a92804..8d04471a63 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4341,12 +4341,11 @@ kill-ring-yank-pointer "The tail of the kill ring whose car is the last thing yanked.") (defcustom save-interprogram-paste-before-kill nil - "Save clipboard strings into kill ring before replacing them. -When one selects something in another program to paste it into Emacs, -but kills something in Emacs before actually pasting it, -this selection is gone unless this variable is non-nil, -in which case the other program's selection is saved in the `kill-ring' -before the Emacs kill and one can still paste it using \\[yank] \\[yank-pop]." + "Save existing clipboard text into kill ring before replacing it. +A non-nil value ensures that Emacs kill operations do not +irrevocably overwrite existing clipboard text by saving it to the +`kill-ring' prior to the kill. Such text can subsequently be +retrieved via \\[yank] \\[yank-pop]]." :type 'boolean :group 'killing :version "23.2") @@ -4366,7 +4365,7 @@ kill-new the front of the kill ring, rather than being added to the list. When `save-interprogram-paste-before-kill' and `interprogram-paste-function' -are non-nil, saves the interprogram paste string(s) into `kill-ring' before +are non-nil, save the interprogram paste string(s) into `kill-ring' before STRING. When the yank handler has a non-nil PARAM element, the original STRING @@ -4402,20 +4401,24 @@ kill-new (if interprogram-cut-function (funcall interprogram-cut-function string))) -;; It has been argued that this should work similar to `self-insert-command' -;; which merges insertions in undo-list in groups of 20 (hard-coded in cmds.c). +;; It has been argued that this should work like `self-insert-command' +;; which merges insertions in `buffer-undo-list' in groups of 20 +;; (hard-coded in `undo-auto-amalgamate'). (defcustom kill-append-merge-undo nil - "Whether appending to kill ring also makes \\[undo] restore both pieces of text simultaneously." + "Amalgamate appending kills with the last kill for undo. +When non-nil, appending or prepending text to the last kill makes +\\[undo] restore both pieces of text simultaneously." :type 'boolean :group 'killing :version "25.1") (defun kill-append (string before-p) "Append STRING to the end of the latest kill in the kill ring. -If BEFORE-P is non-nil, prepend STRING to the kill. -Also removes the last undo boundary in the current buffer, - depending on `kill-append-merge-undo'. -If `interprogram-cut-function' is set, pass the resulting kill to it." +If BEFORE-P is non-nil, prepend STRING to the kill instead. +If `interprogram-cut-function' is non-nil, call it with the +resulting kill. +If `kill-append-merge-undo' is non-nil, remove the last undo +boundary in the current buffer." (let* ((cur (car kill-ring))) (kill-new (if before-p (concat string cur) (concat cur string)) (or (= (length cur) 0) -- 2.17.0 --=-=-= Content-Type: text/plain "Basil L. Contovounesios" writes: > Patch addressing this to follow. I attach two patches. The first makes current-kill disable interprogram-paste-function in addition to interprogram-cut-function before calling kill-new. The second suggests potential clarifications in related documentation, both in '(elisp) Low-Level Kill Ring' and simple.el docstrings. Hopefully someone can further improve upon these. Thanks, -- Basil --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 18 13:54:48 2018 Received: (at control) by debbugs.gnu.org; 18 Apr 2018 17:54:49 +0000 Received: from localhost ([127.0.0.1]:59544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8rI8-0003jh-Ik for submit@debbugs.gnu.org; Wed, 18 Apr 2018 13:54:48 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:45599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8rI7-0003jV-Kb for control@debbugs.gnu.org; Wed, 18 Apr 2018 13:54:47 -0400 Received: by mail-wr0-f169.google.com with SMTP id u11-v6so7106154wri.12 for ; Wed, 18 Apr 2018 10:54:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:mail-followup-to:date:message-id:user-agent :mime-version; bh=Z5AVEoujp1iZEAQ3ddguaqfETd8wH71bPyiMERoivuU=; b=rye9BCQO79eF6a7JmdYDrJj2J6JJtueHEjk++KVSpiwMccRdxxwvc/XkJ/o0jo1esk FMbB1GxFPVpAT0sk5Z1pXMBrT264UNsdEd8RNsiwhES4bRS5QDlaqz0HySbYo74ZkY3v Sp2O+Z9AIqQGckuzeU08Ql6K12K4NyfLemv0g9FklCVYkXOn0IiQhFvrlfcUnbrt3bDx Q0YkMvELbXFZNrDEBQ9oj27ohcSP0nK9sqsjF7aTCdNYS+a/DRiyJnA1Q048eCPzibdB pMLvBgAC1YVXy5+l5MGvVzAkwOilq+AtVCtOJtUJlr6TSsNyZmsRtlgM0aQbltzBU55u Qpiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:mail-followup-to:date:message-id :user-agent:mime-version; bh=Z5AVEoujp1iZEAQ3ddguaqfETd8wH71bPyiMERoivuU=; b=L8C3V8RBFmVgtptwby/inx7Ad54BVO+xuvQlofcQ33PwldFwX76gj8niU0xQxofRzL bL2WGMw1il57EuI2P+nnpjkzenGaiTjxvNBY9z8sfA/S0/8rxeOdQfOOr5/twX76d/er AerkoKwnkriOCeDjLhDoFEAY5PZPJlgDxqhg1FlEW1RFSkc9Q2RVwE9vvZy1phJp8tiL l/WiP1qCeh51JdVcM4oJRd9ea8fghGxALSzAE6sF+E+IvCizc3Yfuj26HVk7xaE3bExa EQFy7xjIwEuaPjRPMjCZhtYjZJ2EGUK8/P57tX5AKzu8OhLbOuHVw9njqVJ+0Osgp0y/ i6Sw== X-Gm-Message-State: ALQs6tAmsdOitB78JTg2uo8TsGkTVif0BSRZGq095gg1ZEYDDRdZkHj9 kCYhWjaplOO5LFKU/d1zeQ3pqi2f X-Google-Smtp-Source: AIpwx49LMf2NqUwlCdw8vOyoi2jiby+dNVDmWSq6NLHsWvdTh+tyYUWI0GXSz6ds07oHRw8YwRO/Hg== X-Received: by 10.80.212.14 with SMTP id t14mr4427200edh.75.1524074081407; Wed, 18 Apr 2018 10:54:41 -0700 (PDT) Received: from localhost ([213.233.149.19]) by smtp.gmail.com with ESMTPSA id k24sm1220983ede.62.2018.04.18.10.54.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Apr 2018 10:54:40 -0700 (PDT) From: "Basil L. Contovounesios" To: control@debbugs.gnu.org Subject: Re: bug#31209: 27.0.50; current-kill calls interprogram-paste-function more than once Mail-Followup-To: control@debbugs.gnu.org Date: Wed, 18 Apr 2018 18:54:39 +0100 Message-ID: <87y3hk1jts.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 31209 patch From unknown Mon Jun 23 09:41:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31209: 27.0.50; current-kill calls interprogram-paste-function more than once Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 18:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31209 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: <31209@debbugs.gnu.org> Received: via spool by 31209-submit@debbugs.gnu.org id=B31209.15240779022608 (code B ref 31209); Wed, 18 Apr 2018 18:59:02 +0000 Received: (at 31209) by debbugs.gnu.org; 18 Apr 2018 18:58:22 +0000 Received: from localhost ([127.0.0.1]:59582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8sHe-0000fz-Ce for submit@debbugs.gnu.org; Wed, 18 Apr 2018 14:58:22 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:36021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8sHa-0000fg-GS for 31209@debbugs.gnu.org; Wed, 18 Apr 2018 14:58:20 -0400 Received: by mail-wr0-f175.google.com with SMTP id q13-v6so7583104wre.3 for <31209@debbugs.gnu.org>; Wed, 18 Apr 2018 11:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:references:mail-followup-to:date:in-reply-to :message-id:user-agent:mime-version; bh=9X/uitVVxySq4fywrFK3/SgEE0llFqtQPBZIVCSTrhE=; b=Z55qP6dRtqFhFv9uaFQRGVcWsRGv9s/SSW9N+aKeuLC0NlfyZYTHv7BFtoAP0v4XP5 IYGuazl5k7R2XGxiK3JId5B4Glgwl/e/1/w8+Ht3DiyKywbMABY4Sts7xMTg5Ug2xbt0 tKEMFN/a2aDB3xUEnCsapa05s71FOuqVoVmc1NZdJIBTdvmlXwyucBzJsZBQC6R+wcax DduB2gMIvwMkIT9tlwpTxmaXiRcpO/yn9oMiT03Jx3Xd92jqVNVLDDeWO1nCk4C5E+yQ 0l4qeEi0B3t9V4UPdap7zSM6D9q6xP/62PRZZIXUNngh4wISAPE37tehWv3xSPBlUtT1 +qlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:mail-followup-to:date :in-reply-to:message-id:user-agent:mime-version; bh=9X/uitVVxySq4fywrFK3/SgEE0llFqtQPBZIVCSTrhE=; b=RphZ2nRdbkKCrHvWU94A90rs5jtHOl1PWq4pK3XFvD2zCdzeu5wi6o+NfJGoOllSzs 2+SnFKX9Z/Tofy3t0LGIzt38j84f070uUZZ4cg9tkk0UQPvvzRJPMXGMJxXajm/lqNfz MStj7QiD1t+BXSbpVqWmG7qDxo+6xTkvOU6SVwKLxTojt37m5hiPTUTaH8xjynvNOn8/ lPRLbViN1VHV6+u01aPsTJpco5RGge+68xOqB8VTqBSr//4AUJo04yOrsq7xUHUdrs5g 6lEBZWCzCH4dgWCVpSSpQlRqcYo8GT7ip657jgnshhqCbEJZd3sq4KtXgAXvATKr12DV KbGw== X-Gm-Message-State: ALQs6tC9ZjwXeo4/ftRec1GEDtEQEs8bmQnTYiXBP3vpFojYYb2RzjJ/ KvWUx76Y64kdYRpqJGdoxYvsbFsH X-Google-Smtp-Source: AIpwx48wmcNilf8gbPFLhCT36VuBQlEdfcVZWM2UkRaK3EiCie2ZIVWPWTnbkKDyxLtbIpPbFeUvLw== X-Received: by 10.80.184.74 with SMTP id k10mr4744880ede.307.1524077892557; Wed, 18 Apr 2018 11:58:12 -0700 (PDT) Received: from localhost ([213.233.149.14]) by smtp.gmail.com with ESMTPSA id i6sm1241399edk.23.2018.04.18.11.58.11 for <31209@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Apr 2018 11:58:11 -0700 (PDT) From: "Basil L. Contovounesios" References: <877ep42yqv.fsf@tcd.ie> <8736zs2yi4.fsf@tcd.ie> Mail-Followup-To: <31209@debbugs.gnu.org> Date: Wed, 18 Apr 2018 19:58:10 +0100 In-Reply-To: <8736zs2yi4.fsf@tcd.ie> (Basil L. Contovounesios's message of "Wed, 18 Apr 2018 18:52:19 +0100") Message-ID: <878t9k1gvx.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: "Basil L. Contovounesios" writes: > The second suggests potential clarifications in related documentation, > both in '(elisp) Low-Level Kill Ring' and simple.el docstrings. > Hopefully someone can further improve upon these. [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [213.233.149.14 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.175 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.128.175 listed in list.dnswl.org] 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) "Basil L. Contovounesios" writes: > The second suggests potential clarifications in related documentation, > both in '(elisp) Low-Level Kill Ring' and simple.el docstrings. > Hopefully someone can further improve upon these. I just noticed one more thing. The docstring of interprogram-paste-function ends with: Note that the function should return a string only if a program other than Emacs has provided a string for pasting; if Emacs provided the most recent string, the function should return nil. If it is difficult to tell whether Emacs or some other program provided the current string, it is probably good enough to return nil if the string is equal (according to `string=') to the last ^^^^^^^ text Emacs provided. Would equal-including-properties (as per kill-do-not-save-duplicates) be more accurate here, or is string= fine? -- Basil From unknown Mon Jun 23 09:41:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31209: 27.0.50; current-kill calls interprogram-paste-function more than once Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Apr 2018 11:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31209 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: <31209@debbugs.gnu.org> Received: via spool by 31209-submit@debbugs.gnu.org id=B31209.152465738832375 (code B ref 31209); Wed, 25 Apr 2018 11:57:02 +0000 Received: (at 31209) by debbugs.gnu.org; 25 Apr 2018 11:56:28 +0000 Received: from localhost ([127.0.0.1]:38811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fBJ2B-0008Q2-W9 for submit@debbugs.gnu.org; Wed, 25 Apr 2018 07:56:28 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:44173) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fBJ29-0008Pi-Mt; Wed, 25 Apr 2018 07:56:26 -0400 Received: by mail-io0-f181.google.com with SMTP id d11-v6so18593833iof.11; Wed, 25 Apr 2018 04:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=CPBk4bOMR8eggb9Kln1FyAf5oltV/RFM13WOMMBtGGY=; b=qizGD8EqGCSvFzCsB3b+i6c/3piGBA+LiZrkBs8uB6w/5jKzL2zPeUrAL6bfmR6Mp6 fZSFiLujKrWzM6K0oqiTtvX5jvtgRsGLLApF3ztQAk12s+3m8Ayzumfy6Q35xW+kvmnR mxZ4EcfCUHYmSS6p5jafwspKqZWoBtD7pE9/qYVE75IJqd0PYwSI6kvXEz3qjXSvYRQ5 jYiZmxlqBJ7OutDtzuXOEFjuX2ovAIpbQ1mnYrq+MavXqqwSkosN0TimluXZByN2dPYH zBaB22BdNhXF+CCctlmHYZDIqer+z6M6+dZRKscT/tWuolpieIY9SmbAmpGCZB+M//FV Ku0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=CPBk4bOMR8eggb9Kln1FyAf5oltV/RFM13WOMMBtGGY=; b=ffxTjj8GlgU7K5zdxbrNk8glttKXsjgESXqQ2goiDKwQD0LoXv7SsaY9CwbI651t9/ xIr3RZ1c0ur8aqMKXrQpEUQP6y6ZXPGyxiwNh+MFnHa0LwDLy9pYUb+e8hCKRCkoKc5y wmOep2EZYMNiUDHRpeFM3FUz/h/pa6L2xGpE8ImrGTkpe9imxKnoY+6jR6UAWaA3CNHx V+P7tkh3IjJJ+RkdlMwRUI79+3hzzOCtvCRRdVwXZjs4WcC1+bHs/i9PJKdqmL9MuwQ1 QNfiYKjSHprG/8jokbLYOJA5VzvBf+iRrKV0Q7qTVlnnVYCzyYPpJb1KOZjTx3rnYNCt PRIg== X-Gm-Message-State: ALQs6tCOJKdg84GVBso91iL/XC7UK+hk6YRJt9ArV49mG+EVegC7MD2A 4th6xsdyuQA0b30bSATCCpgq6w== X-Google-Smtp-Source: AB8JxZp2rCOjXJ4cbgjnsNm2Cb2+xRl06aoXHCGE6KPj9iVGzr48DOeAh1WmHe8ZgAMCikxzVXGbkQ== X-Received: by 2002:a6b:2e67:: with SMTP id i100-v6mr5104166ioo.193.1524657379830; Wed, 25 Apr 2018 04:56:19 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id g16-v6sm6416386ita.0.2018.04.25.04.56.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Apr 2018 04:56:19 -0700 (PDT) From: Noam Postavsky References: <877ep42yqv.fsf@tcd.ie> <8736zs2yi4.fsf@tcd.ie> Date: Wed, 25 Apr 2018 07:56:18 -0400 In-Reply-To: <8736zs2yi4.fsf@tcd.ie> (Basil L. Contovounesios's message of "Wed, 18 Apr 2018 18:52:19 +0100") Message-ID: <871sf3sdnh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 31209 fixed close 31209 27.1 quit "Basil L. Contovounesios" writes: > The first makes current-kill disable interprogram-paste-function in > addition to interprogram-cut-function before calling kill-new. Pushed to master [1: 532f5fb387]. > The second suggests potential clarifications in related documentation, > both in '(elisp) Low-Level Kill Ring' and simple.el docstrings. > Hopefully someone can further improve upon these. Pushed to emacs-26 [2: 343d70b10e]. [1: 532f5fb387]: 2018-04-25 07:37:32 -0400 Do not call interprogram-paste-function repeatedly https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=532f5fb3877ccd535a822f7c3c08d396621b4325 [2: 343d70b10e]: 2018-04-24 20:58:15 -0400 Improve kill-related documentation (bug#31209) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=343d70b10edbd42ebe49ada3a8ef878b2ee044f0 > I just noticed one more thing. The docstring of > interprogram-paste-function ends with: > > Note that the function should return a string only if a program > other than Emacs has provided a string for pasting; if Emacs > provided the most recent string, the function should return nil. > If it is difficult to tell whether Emacs or some other program > provided the current string, it is probably good enough to return > nil if the string is equal (according to `string=') to the last > ^^^^^^^ > text Emacs provided. > > Would equal-including-properties (as per kill-do-not-save-duplicates) be > more accurate here, or is string= fine? I guess if we're talking about strings coming from other programs, properties are unlikely to show up.