changeset 83084:0d3eea319893

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
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 26 Mar 2004 04:35:08 +0000
parents e4a9e06cbd64
children c0e839b60d0b
files README.multi-tty lisp/faces.el lisp/simple.el lisp/term/x-win.el
diffstat 4 files changed, 28 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/README.multi-tty	Thu Mar 25 22:27:43 2004 +0000
+++ b/README.multi-tty	Fri Mar 26 04:35:08 2004 +0000
@@ -164,13 +164,14 @@
 The following is an (incomplete) list of people who have contributed
 to the project by testing, bug reports, and suggestions.  Thanks!
 
-Robert J. Chassel <bob at rattlesnake dot com>
+Robert J. Chassell <bob at rattlesnake dot com>
 Romain Francoise <romain at orebokech dot com>
 Ami Fischman <ami at fischman dot org>
 Istvan Marko <mi-mtty ar kismala dot com>
 Dan Nicolaescu <dann at ics dot uci dot edu>
 Gergely Nagy <algernon at debian dot org>
 Mark Plaksin <happy at mcplaksin dot org>
+Francisco Borges <borges at let dot rug dot nl>
 
 Richard Stallman was kind enough to review my patches.
 
@@ -182,11 +183,6 @@
 THINGS TO DO
 ------------
 
-** Robert Chassell has found serious copy-paste bugs with the
-   multi-tty branch.  There seem to be redisplay bugs while copying
-   from X to a terminal frame.  Copying accented characters do not
-   work for me.
-
 ** Emacs assumes that all terminal frames have the same locale
    settings as Emacs itself.  This may lead to bogus results in a
    multi-locale setup. (E.g., while logging in from a remote client
@@ -196,7 +192,8 @@
    sometimes; Emacs does not respond to stimuli from other keyboards.
    At least a beep or a message would be important, if the single-mode
    is still required to prevent interference.  (Reported by Dan
-   Nicolaescu.)
+   Nicolaescu.)  (Update: selecting a region with the mouse enables
+   single_kboard under X.  This is very confusing.)
 
 ** Change Lisp code not to (getenv "TERM"); use the `tty-type' frame
    parameter or the frame-tty-type function instead.
@@ -736,5 +733,17 @@
 
    (This is gone.)
 
+-- Robert Chassell has found serious copy-paste bugs with the
+   multi-tty branch.  There seem to be redisplay bugs while copying
+   from X to a terminal frame.  Copying accented characters do not
+   work for me.
+
+   (Patch-124 should fix this, by changing the interprogram-*-function
+   variables to be frame-local, as suggested by Mark Plaksin
+   (thanks!).  I think that the redisplay bugs are in fact not bugs,
+   but delays caused by single_kboard --> perhaps MULTI_KBOARD should
+   be removed.)
+
+
 
 ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d
--- a/lisp/faces.el	Thu Mar 25 22:27:43 2004 +0000
+++ b/lisp/faces.el	Fri Mar 26 04:35:08 2004 +0000
@@ -1680,6 +1680,11 @@
 	  (if (or (null frame-list) (null visibility-spec))
 	      (make-frame-visible frame)
 	    (modify-frame-parameters frame (list visibility-spec)))
+	  ;; Arrange for the kill and yank functions to set and check the clipboard.
+	  (modify-frame-parameters
+	   frame '((interprogram-cut-function . x-select-text)))
+	  (modify-frame-parameters
+	   frame '((interprogram-paste-function . x-cut-buffer-or-selection-value)))
 	  (setq success t))
       (unless success
 	(delete-frame frame)))
@@ -1777,6 +1782,9 @@
 		      (if (setq hyphend (string-match "[-_][^-_]+$" term))
 			  (substring term 0 hyphend)
 			nil)))))
+	  ;; Make sure the kill and yank functions do not touch the X clipboard.
+	  (modify-frame-parameters frame '((interprogram-cut-function . nil)))
+	  (modify-frame-parameters frame '((interprogram-paste-function . nil)))
 	  (setq success t))
       (unless success
 	(select-frame old-frame)
--- a/lisp/simple.el	Thu Mar 25 22:27:43 2004 +0000
+++ b/lisp/simple.el	Fri Mar 26 04:35:08 2004 +0000
@@ -1788,6 +1788,8 @@
 The second, optional, argument PUSH, has the same meaning as the
 similar argument to `x-set-cut-buffer', which see.")
 
+(make-variable-frame-local 'interprogram-cut-function)
+
 (defvar interprogram-paste-function nil
   "Function to call to get text cut from other programs.
 
@@ -1808,6 +1810,8 @@
 difficult to tell whether Emacs or some other program provided the
 current string, it is probably good enough to return nil if the string
 is equal (according to `string=') to the last text Emacs provided.")
+
+(make-variable-frame-local 'interprogram-paste-function)
 
 
 
--- a/lisp/term/x-win.el	Thu Mar 25 22:27:43 2004 +0000
+++ b/lisp/term/x-win.el	Fri Mar 26 04:35:08 2004 +0000
@@ -2445,10 +2445,6 @@
   ;; Don't let Emacs suspend under X.
   (add-hook 'suspend-hook 'x-win-suspend-error)
 
-  ;; 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)
-
   ;; Turn off window-splitting optimization; X is usually fast enough
   ;; that this is only annoying.
   (setq split-window-keep-point t)