aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-03-18 03:38:25 +0000
committerKarl Heuer1994-03-18 03:38:25 +0000
commit4390cc9c3afe81bbdd171cf810a991342082da52 (patch)
tree4fb3a288f567616aa1e7ce999be800f9e1d7b64b
parent2f1b0bbdb0a80ecbe2ab4d04253513f0c65979a2 (diff)
downloademacs-4390cc9c3afe81bbdd171cf810a991342082da52.tar.gz
emacs-4390cc9c3afe81bbdd171cf810a991342082da52.zip
(x-cut-buffer-or-selection-value): Check for error from x-get-selection.
-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."
556 (x-set-selection 'PRIMARY text) 556 (x-set-selection 'PRIMARY text)
557 (setq x-last-selected-text text)) 557 (setq x-last-selected-text text))
558 558
559;;; Return the value of the current X selection. For compatibility 559;;; Return the value of the current X selection.
560;;; with older X applications, this checks cut buffer 0 before 560;;; Consult the selection, then the cut buffer. Treat empty strings
561;;; retrieving the value of the primary selection. 561;;; as if they were unset.
562(defun x-cut-buffer-or-selection-value () 562(defun x-cut-buffer-or-selection-value ()
563 (let (text) 563 (let (text)
564 564
565 ;; Consult the selection, then the cut buffer. Treat empty strings 565 ;; Don't die if x-get-selection signals an error.
566 ;; as if they were unset. 566 (condition-case c
567 (setq text (x-get-selection 'PRIMARY)) 567 (setq text (x-get-selection 'PRIMARY))
568 (error (message "%s" c)))
568 (if (string= text "") (setq text nil)) 569 (if (string= text "") (setq text nil))
569 (or text (setq text (x-get-cut-buffer 0))) 570 (or text (setq text (x-get-cut-buffer 0)))
570 (if (string= text "") (setq text nil)) 571 (if (string= text "") (setq text nil))