Commit 026ad6ba authored by Karoly Lorentey's avatar Karoly Lorentey
Browse files

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
parent 945c3bbb
......@@ -164,13 +164,14 @@ THANKS
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 @@ See arch logs.
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 @@ THINGS TO DO
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 @@ DIARY OF CHANGES
(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
......@@ -1680,6 +1680,11 @@ Value is the new frame created."
(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 @@ created."
(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)
......
......@@ -1788,6 +1788,8 @@ the text which should be made available.
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 @@ most recent string, the function should return nil. If it is
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)
......
......@@ -2445,10 +2445,6 @@ order until succeed.")
;; 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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment