From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#31209: 27.0.50; current-kill calls interprogram-paste-function more than once Date: Wed, 18 Apr 2018 18:47:04 +0100 Message-ID: <877ep42yqv.fsf@tcd.ie> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1524073568 27717 195.159.176.226 (18 Apr 2018 17:46:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 18 Apr 2018 17:46:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: 31209@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 18 19:46:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8r9e-00076z-2O for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Apr 2018 19:46:02 +0200 Original-Received: from localhost ([::1]:41699 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8rBk-0001kf-PT for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Apr 2018 13:48:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8rBd-0001je-4e for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 13:48:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8rBa-0002jo-1s for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 13:48:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51638) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f8rBZ-0002jk-SZ for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 13:48:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f8rBZ-0003aH-MP for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 13:48:01 -0400 X-Loop: help-debbugs@gnu.org 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: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.152407364213731 (code B ref -1); Wed, 18 Apr 2018 17:48:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Apr 2018 17:47:22 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) Original-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) Mail-Followup-To: bug-gnu-emacs@gnu.org 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:145578 Archived-At: 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