summaryrefslogtreecommitdiff
path: root/lisp/term
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-07-23 17:24:45 +0000
committerRichard M. Stallman <rms@gnu.org>1993-07-23 17:24:45 +0000
commita831e46dfc73ea16aefd2e12b99c1f4ca3713e17 (patch)
treefe64a291800f9e8ca3d920c85172cd6156386488 /lisp/term
parent91e8a3aec83452b86e9d92e91fec31fdf48cb995 (diff)
downloademacs-a831e46dfc73ea16aefd2e12b99c1f4ca3713e17.tar.gz
(x-select-text): Always set the cut buffer,
but sometimes set it to nothing. Don't put large strings in clipboard.
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/x-win.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 98889b96046..f853788075a 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -491,8 +491,10 @@ This returns ARGS with the arguments that have been processed removed."
;;; from x-cut-buffer-or-selection-value.
(defvar x-last-selected-text nil)
+;;; It is said that overlarge strings are slow to put into the cut buffer,
+;;; and would crash the clipboard.
(defvar x-cut-buffer-max 20000
- "Max number of characters to put in the cut buffer.")
+ "Max number of characters to put in the cut buffer or clipboard.")
;;; Make TEXT, a string, the primary and clipboard X selections.
;;; If you are running xclipboard, this means you can effectively
@@ -503,8 +505,10 @@ This returns ARGS with the arguments that have been processed removed."
;; Don't send the cut buffer too much text.
;; It becomes slow, and if really big it causes errors.
(if (< (length text) x-cut-buffer-max)
- (x-set-cut-buffer text push))
- (x-set-selection 'CLIPBOARD text)
+ (progn
+ (x-set-cut-buffer text push)
+ (x-set-selection 'CLIPBOARD text))
+ (x-set-cut-buffer "" push))
(x-set-selection 'PRIMARY text)
(setq x-last-selected-text text))