comparison lisp/term/x-win.el @ 1266:bf6b4bc3ccc0

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Tue, 29 Sep 1992 17:43:45 +0000
parents cfda1fa93624
children da9a60e97e72
comparison
equal deleted inserted replaced
1265:cfda1fa93624 1266:bf6b4bc3ccc0
480 480
481 ;;; Return the value of the current X selection. For compatibility 481 ;;; Return the value of the current X selection. For compatibility
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)
494 (setq interprogram-paste-function 'x-cut-buffer-or-selection-value) 506 (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
495 507