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