# HG changeset patch # User Karl Heuer # Date 763961905 0 # Node ID 96ec63c4a3478a02c7b763a403376595af297c5d # Parent f0575c116207d232824c19e54a3a4c9e50e7e8b8 (x-cut-buffer-or-selection-value): Check for error from x-get-selection. diff -r f0575c116207 -r 96ec63c4a347 lisp/term/x-win.el --- 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))