diff options
author | Karl Heuer <kwzh@gnu.org> | 1994-03-18 03:38:25 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1994-03-18 03:38:25 +0000 |
commit | 4390cc9c3afe81bbdd171cf810a991342082da52 (patch) | |
tree | 4fb3a288f567616aa1e7ce999be800f9e1d7b64b /lisp/term/x-win.el | |
parent | 2f1b0bbdb0a80ecbe2ab4d04253513f0c65979a2 (diff) | |
download | emacs-4390cc9c3afe81bbdd171cf810a991342082da52.tar.gz emacs-4390cc9c3afe81bbdd171cf810a991342082da52.tar.bz2 emacs-4390cc9c3afe81bbdd171cf810a991342082da52.zip |
(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.el | 13 |
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)) |