changeset 6399:96ec63c4a347

(x-cut-buffer-or-selection-value): Check for error from x-get-selection.
author Karl Heuer <kwzh@gnu.org>
date Fri, 18 Mar 1994 03:38:25 +0000
parents f0575c116207
children 5ef02598a0ad
files lisp/term/x-win.el
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/x-win.el	Fri Mar 18 03:21:45 1994 +0000
+++ b/lisp/term/x-win.el	Fri Mar 18 03:38:25 1994 +0000
@@ -556,15 +556,16 @@
   (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))