aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2004-03-26 04:35:08 +0000
committerKaroly Lorentey2004-03-26 04:35:08 +0000
commit026ad6ba8148d468a0a61a1c863a63ef58054e50 (patch)
tree050282708d227f6431d38f978a62c4222fca670e /lisp
parent945c3bbb15ab1af18e94ab6f81e9c72c8ce1402f (diff)
downloademacs-026ad6ba8148d468a0a61a1c863a63ef58054e50.tar.gz
emacs-026ad6ba8148d468a0a61a1c863a63ef58054e50.zip
Fix cut'n'paste during a multi-display session (Mark Plaksin, Robert Chassell).
lisp/simple.el: Make interprogram-cut-function and interprogram-paste-function frame-local. (Reported by Mark Plaksin and Robert Chassell). lisp/faces.el (x-create-frame-with-faces) (tty-create-frame-with-faces): Set the interprogram-cut-function and interprogram-paste-function frame parameters. lisp/x-win.el (x-initialize-window-system): Don't set interprogram-cut-function and interprogram-paste-function. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-124
Diffstat (limited to 'lisp')
-rw-r--r--lisp/faces.el8
-rw-r--r--lisp/simple.el4
-rw-r--r--lisp/term/x-win.el4
3 files changed, 12 insertions, 4 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index c7123e0229e..2c9fbb8206e 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1680,6 +1680,11 @@ Value is the new frame created."
1680 (if (or (null frame-list) (null visibility-spec)) 1680 (if (or (null frame-list) (null visibility-spec))
1681 (make-frame-visible frame) 1681 (make-frame-visible frame)
1682 (modify-frame-parameters frame (list visibility-spec))) 1682 (modify-frame-parameters frame (list visibility-spec)))
1683 ;; Arrange for the kill and yank functions to set and check the clipboard.
1684 (modify-frame-parameters
1685 frame '((interprogram-cut-function . x-select-text)))
1686 (modify-frame-parameters
1687 frame '((interprogram-paste-function . x-cut-buffer-or-selection-value)))
1683 (setq success t)) 1688 (setq success t))
1684 (unless success 1689 (unless success
1685 (delete-frame frame))) 1690 (delete-frame frame)))
@@ -1777,6 +1782,9 @@ created."
1777 (if (setq hyphend (string-match "[-_][^-_]+$" term)) 1782 (if (setq hyphend (string-match "[-_][^-_]+$" term))
1778 (substring term 0 hyphend) 1783 (substring term 0 hyphend)
1779 nil))))) 1784 nil)))))
1785 ;; Make sure the kill and yank functions do not touch the X clipboard.
1786 (modify-frame-parameters frame '((interprogram-cut-function . nil)))
1787 (modify-frame-parameters frame '((interprogram-paste-function . nil)))
1780 (setq success t)) 1788 (setq success t))
1781 (unless success 1789 (unless success
1782 (select-frame old-frame) 1790 (select-frame old-frame)
diff --git a/lisp/simple.el b/lisp/simple.el
index 6bc89ae1750..13cb63af240 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1788,6 +1788,8 @@ the text which should be made available.
1788The second, optional, argument PUSH, has the same meaning as the 1788The second, optional, argument PUSH, has the same meaning as the
1789similar argument to `x-set-cut-buffer', which see.") 1789similar argument to `x-set-cut-buffer', which see.")
1790 1790
1791(make-variable-frame-local 'interprogram-cut-function)
1792
1791(defvar interprogram-paste-function nil 1793(defvar interprogram-paste-function nil
1792 "Function to call to get text cut from other programs. 1794 "Function to call to get text cut from other programs.
1793 1795
@@ -1808,6 +1810,8 @@ most recent string, the function should return nil. If it is
1808difficult to tell whether Emacs or some other program provided the 1810difficult to tell whether Emacs or some other program provided the
1809current string, it is probably good enough to return nil if the string 1811current string, it is probably good enough to return nil if the string
1810is equal (according to `string=') to the last text Emacs provided.") 1812is equal (according to `string=') to the last text Emacs provided.")
1813
1814(make-variable-frame-local 'interprogram-paste-function)
1811 1815
1812 1816
1813 1817
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index da5ac04a6c9..cd26352a962 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -2445,10 +2445,6 @@ order until succeed.")
2445 ;; Don't let Emacs suspend under X. 2445 ;; Don't let Emacs suspend under X.
2446 (add-hook 'suspend-hook 'x-win-suspend-error) 2446 (add-hook 'suspend-hook 'x-win-suspend-error)
2447 2447
2448 ;; Arrange for the kill and yank functions to set and check the clipboard.
2449 (setq interprogram-cut-function 'x-select-text)
2450 (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
2451
2452 ;; Turn off window-splitting optimization; X is usually fast enough 2448 ;; Turn off window-splitting optimization; X is usually fast enough
2453 ;; that this is only annoying. 2449 ;; that this is only annoying.
2454 (setq split-window-keep-point t) 2450 (setq split-window-keep-point t)