aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1992-09-29 17:43:45 +0000
committerJim Blandy1992-09-29 17:43:45 +0000
commitf6c7b4e77c161bfc0adc6eb1af68324c9dceb5c9 (patch)
tree93eb42f94d05a9e1b3004d606e7858439fa740c2
parent60eb4bbf3dc8fd627723066aafb1cdb40c1fc6a3 (diff)
downloademacs-f6c7b4e77c161bfc0adc6eb1af68324c9dceb5c9.tar.gz
emacs-f6c7b4e77c161bfc0adc6eb1af68324c9dceb5c9.zip
*** empty log message ***
-rw-r--r--lisp/term/x-win.el24
1 files changed, 18 insertions, 6 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 2cbfde7658d..7fb3276b8d7 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -482,12 +482,24 @@ turn off scroll bars; otherwise, turn on scroll bars."
482;;; with older X applications, this checks cut buffer 0 before 482;;; with older X applications, this checks cut buffer 0 before
483;;; retrieving the value of the primary selection. 483;;; retrieving the value of the primary selection.
484(defun x-cut-buffer-or-selection-value () 484(defun x-cut-buffer-or-selection-value ()
485 (let ((text (or (x-selection-value)))) 485 (let (text)
486 (if (or (string= text x-last-selected-text) 486
487 (string= "")) 487 ;; Consult the cut buffer, then the selection. Treat empty strings
488 nil 488 ;; as if they were unset.
489 (setq x-last-selected-text nil) 489 (setq text (x-get-cut-buffer 0))
490 text))) 490 (if (string= text "") (setq text nil))
491 (or text (setq text (x-get-cut-buffer 0)))
492 (if (string= text "") (setq text nil))
493
494 (cond
495 ((not text) nil)
496 ((eq text x-last-selected-text) nil)
497 ((string= text x-last-selected-text)
498 ;; Record the newer string, so subsequent calls can use the `eq' test.
499 (setq x-last-selected-text text)
500 nil)
501 (t
502 (setq x-last-selected-text text)))))
491 503
492;;; Arrange for the kill and yank functions to set and check the clipboard. 504;;; Arrange for the kill and yank functions to set and check the clipboard.
493(setq interprogram-cut-function 'x-select-text) 505(setq interprogram-cut-function 'x-select-text)