From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: 31209@debbugs.gnu.org
Subject: bug#31209: 27.0.50; current-kill calls interprogram-paste-function more than once
Date: Wed, 18 Apr 2018 18:47:04 +0100 [thread overview]
Message-ID: <877ep42yqv.fsf@tcd.ie> (raw)
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' = %s"
i kill-ring))
to evaluate to:
‘interprogram-paste-function’ called 1 time(s)
‘kill-ring’ = (a b c)
but the actual result is:
‘interprogram-paste-function’ called 4 time(s)
‘kill-ring’ = (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=4ed8c7aadb59c8ae75641710e3d9ff5bddbbd952
Patch addressing this to follow.
Thanks,
--
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
next reply other threads:[~2018-04-18 17:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-18 17:47 Basil L. Contovounesios [this message]
2018-04-18 17:52 ` bug#31209: 27.0.50; current-kill calls interprogram-paste-function more than once Basil L. Contovounesios
2018-04-18 18:58 ` Basil L. Contovounesios
2018-04-25 11:56 ` Noam Postavsky
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=877ep42yqv.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=31209@debbugs.gnu.org \
/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).