summaryrefslogtreecommitdiff
path: root/lisp/term/x-win.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/term/x-win.el')
-rw-r--r--lisp/term/x-win.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index cd26352a962..381ee606300 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -2334,7 +2334,10 @@ order until succeed.")
(defun x-clipboard-yank ()
"Insert the clipboard contents, or the last stretch of killed text."
(interactive)
- (let ((clipboard-text (x-get-selection 'CLIPBOARD))
+ (let ((clipboard-text
+ (condition-case nil
+ (x-get-selection 'CLIPBOARD)
+ (error nil)))
(x-select-enable-clipboard t))
(if (and clipboard-text (> (length clipboard-text) 0))
(kill-new clipboard-text))