summaryrefslogtreecommitdiff
path: root/lisp/term/x-win.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-03-18 03:38:25 +0000
committerKarl Heuer <kwzh@gnu.org>1994-03-18 03:38:25 +0000
commite88f129ddfdc200d08acaf8c9140f9edcc6739e9 (patch)
treefad2ea3a752fe6ddfe2a5c32fc9b1808ab51827e /lisp/term/x-win.el
parent4e6f889bb1e98ed2c1149d97c33dff0cb96e5309 (diff)
downloademacs-e88f129ddfdc200d08acaf8c9140f9edcc6739e9.tar.gz
(x-cut-buffer-or-selection-value): Check for error from x-get-selection.
Diffstat (limited to 'lisp/term/x-win.el')
-rw-r--r--lisp/term/x-win.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 7b7d1b94d4d..dc826b3cc2b 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -556,15 +556,16 @@ This returns ARGS with the arguments that have been processed removed."
(x-set-selection 'PRIMARY text)
(setq x-last-selected-text text))
-;;; Return the value of the current X selection. For compatibility
-;;; with older X applications, this checks cut buffer 0 before
-;;; retrieving the value of the primary selection.
+;;; Return the value of the current X selection.
+;;; Consult the selection, then the cut buffer. Treat empty strings
+;;; as if they were unset.
(defun x-cut-buffer-or-selection-value ()
(let (text)
- ;; Consult the selection, then the cut buffer. Treat empty strings
- ;; as if they were unset.
- (setq text (x-get-selection 'PRIMARY))
+ ;; Don't die if x-get-selection signals an error.
+ (condition-case c
+ (setq text (x-get-selection 'PRIMARY))
+ (error (message "%s" c)))
(if (string= text "") (setq text nil))
(or text (setq text (x-get-cut-buffer 0)))
(if (string= text "") (setq text nil))