summaryrefslogtreecommitdiff
path: root/lisp/simple.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 406f1008df3..65af1d02a1e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5618,8 +5618,14 @@ argument should still be a \"useful\" string for such uses."
(if (fboundp 'menu-bar-update-yank-menu)
(menu-bar-update-yank-menu string (and replace (car kill-ring)))))
(when save-interprogram-paste-before-kill
- (let ((interprogram-paste (and interprogram-paste-function
- (funcall interprogram-paste-function))))
+ (let ((interprogram-paste
+ (and interprogram-paste-function
+ ;; On X, the selection owner might be slow, so the user might
+ ;; interrupt this. If they interrupt it, we want to continue
+ ;; so we become selection owner, so this doesn't stay slow.
+ (if (eq (window-system) 'x)
+ (ignore-error 'quit (funcall interprogram-paste-function))
+ (funcall interprogram-paste-function)))))
(when interprogram-paste
(setq interprogram-paste
(if (listp interprogram-paste)