aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/term
diff options
context:
space:
mode:
authorJim Blandy1992-06-10 02:47:07 +0000
committerJim Blandy1992-06-10 02:47:07 +0000
commit492878e483c355e6851d72cb4e395f069cd02964 (patch)
tree2baa750cf47f09df16d5c89e719e4c81e23d67ca /lisp/term
parent4de86b16296516788a3c65d98b13464c4462549a (diff)
downloademacs-492878e483c355e6851d72cb4e395f069cd02964.tar.gz
emacs-492878e483c355e6851d72cb4e395f069cd02964.zip
*** empty log message ***
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/x-win.el33
1 files changed, 22 insertions, 11 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 368e333d5cc..3f6cefe0a6f 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -437,25 +437,36 @@ This returns ARGS with the arguments that have been processed removed."
437(x-open-connection (or x-display-name 437(x-open-connection (or x-display-name
438 (setq x-display-name (getenv "DISPLAY")))) 438 (setq x-display-name (getenv "DISPLAY"))))
439 439
440;; xterm.c depends on using interrupt-driven input, but we don't want 440;;; xterm.c depends on using interrupt-driven input, but we don't want
441;; the fcntls to apply to the terminal, so we do this after opening 441;;; the fcntls to apply to the terminal, so we do this after opening
442;; the display. 442;;; the display.
443(set-input-mode t nil t) 443(set-input-mode t nil t)
444 444
445(setq screen-creation-function 'x-create-screen) 445(setq screen-creation-function 'x-create-screen)
446(setq suspend-hook 446(setq suspend-hook
447 '(lambda () 447 '(lambda ()
448 (error "Suspending an emacs running under X makes no sense"))) 448 (error "Suspending an emacs running under X makes no sense")))
449(setq interprogram-cut-function 'x-select-text)
450 449
451;; Make TEXT, a string, the primary and clipboard X selections. 450;;; Make TEXT, a string, the primary and clipboard X selections.
452;; If you are running xclipboard, this means you can effectively 451;;; If you are running xclipboard, this means you can effectively
453;; have a window on a copy of the kill-ring. 452;;; have a window on a copy of the kill-ring.
453;;; Also, set the value of X cut buffer 0, for backward compatibility
454;;; with older X application.
454(defun x-select-text (text) 455(defun x-select-text (text)
455 (if (eq window-system 'x) 456 (x-own-selection text 'cut-buffer0)
456 (progn 457 (x-own-selection text 'clipboard)
457 (x-own-selection text 'clipboard) 458 (x-own-selection text))
458 (x-own-selection text)))) 459
460;;; Return the value of the current X selection. For compatibility
461;;; with older X applications, this checks cut buffer 0 before
462;;; retrieving the value of the primary selection.
463(defun x-cut-buffer-or-selection-value ()
464 (or (x-selection-value 'cut-buffer0)
465 (x-selection-value)))
466
467;;; Arrange for the kill and yank functions to set and check the clipboard.
468(setq interprogram-cut-function 'x-select-text)
469(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
459 470
460;;; Turn off window-splitting optimization; X is usually fast enough 471;;; Turn off window-splitting optimization; X is usually fast enough
461;;; that this is only annoying. 472;;; that this is only annoying.