aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/term
diff options
context:
space:
mode:
authorKarl Heuer <[email protected]>1994-03-18 03:38:25 +0000
committerKarl Heuer <[email protected]>1994-03-18 03:38:25 +0000
commit4390cc9c3afe81bbdd171cf810a991342082da52 (patch)
tree4fb3a288f567616aa1e7ce999be800f9e1d7b64b /lisp/term
parent2f1b0bbdb0a80ecbe2ab4d04253513f0c65979a2 (diff)
(x-cut-buffer-or-selection-value): Check for error from x-get-selection.
Diffstat (limited to 'lisp/term')
-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 7b7d1b94d4..dc826b3cc2 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))