[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#31209: 27.0.50; current-kill calls interprogram-paste-function more

From: Basil L. Contovounesios
Subject: bug#31209: 27.0.50; current-kill calls interprogram-paste-function more than once
Date: Wed, 18 Apr 2018 18:47:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Under lexical-binding, I expect the following:

(let* ((i 0)
       (kill-ring ())
       (kill-ring-yank-pointer ())
       (save-interprogram-paste-before-kill t)
        (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.

Patch addressing this to follow.



In GNU Emacs 27.0.50 (build 6, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll 
 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]