[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/term/x-win.el,v
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/term/x-win.el,v |
Date: |
Fri, 09 Nov 2007 19:37:05 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Stefan Monnier <monnier> 07/11/09 19:37:04
Index: term/x-win.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/term/x-win.el,v
retrieving revision 1.216
retrieving revision 1.217
diff -u -b -r1.216 -r1.217
--- term/x-win.el 20 Oct 2007 06:30:18 -0000 1.216
+++ term/x-win.el 9 Nov 2007 19:37:03 -0000 1.217
@@ -2179,6 +2179,8 @@
with older X applications.
address@hidden says it's not desirable to put kills
in the clipboard."
+ ;; With multi-tty, this function may be called from a tty frame.
+ (when (eq (framep (selected-frame)) 'x)
;; Don't send the cut buffer too much text.
;; It becomes slow, and if really big it causes errors.
(cond ((>= (length text) x-cut-buffer-max)
@@ -2196,8 +2198,7 @@
(setq x-last-selected-text-primary text)
(when x-select-enable-clipboard
(x-set-selection 'CLIPBOARD text)
- (setq x-last-selected-text-clipboard text))
- )
+ (setq x-last-selected-text-clipboard text))))
(defvar x-select-request-type nil
"*Data type request for X selection.
@@ -2318,6 +2319,8 @@
;; it returns nil the second time. This is so that a single
;; selection won't be added to the kill ring over and over.
(defun x-cut-buffer-or-selection-value ()
+ ;; With multi-tty, this function may be called from a tty frame.
+ (when (eq (framep (selected-frame)) 'x)
(let (clip-text primary-text cut-text)
(when x-select-enable-clipboard
(setq clip-text (x-selection-value 'CLIPBOARD))
@@ -2327,7 +2330,7 @@
;; from what we remebered them to be last time we did a
;; cut/paste operation.
(setq clip-text
- (cond;; check clipboard
+ (cond ;; check clipboard
((or (not clip-text) (string= clip-text ""))
(setq x-last-selected-text-clipboard nil))
((eq clip-text x-last-selected-text-clipboard) nil)
@@ -2336,16 +2339,14 @@
;; so subsequent calls can use the `eq' test.
(setq x-last-selected-text-clipboard clip-text)
nil)
- (t
- (setq x-last-selected-text-clipboard clip-text))))
- )
+ (t (setq x-last-selected-text-clipboard clip-text)))))
(setq primary-text (x-selection-value 'PRIMARY))
;; Check the PRIMARY selection for 'newness', is it different
;; from what we remebered them to be last time we did a
;; cut/paste operation.
(setq primary-text
- (cond;; check primary selection
+ (cond ;; check primary selection
((or (not primary-text) (string= primary-text ""))
(setq x-last-selected-text-primary nil))
((eq primary-text x-last-selected-text-primary) nil)
@@ -2364,7 +2365,7 @@
;; cut/paste operation.
(setq cut-text
(let ((next-coding (or next-selection-coding-system 'iso-latin-1)))
- (cond;; check cut buffer
+ (cond ;; check cut buffer
((or (not cut-text) (string= cut-text ""))
(setq x-last-selected-text-cut nil))
;; This short cut doesn't work because x-get-cut-buffer
@@ -2410,7 +2411,11 @@
;; primary had been set the cut buffer would essentially never be
;; checked again).
(or clip-text primary-text cut-text)
- ))
+ )))
+
+;; Arrange for the kill and yank functions to set and check the clipboard.
+(setq interprogram-cut-function 'x-select-text)
+(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
(defun x-clipboard-yank ()
"Insert the clipboard contents, or the last stretch of killed text."
- [Emacs-diffs] Changes to emacs/lisp/term/x-win.el,v,
Stefan Monnier <=