aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-07-23 17:24:45 +0000
committerRichard M. Stallman1993-07-23 17:24:45 +0000
commit14324c4d46d7519a697e3d63df7d83c48ef90673 (patch)
tree207cdec7a5f68b5ebf7ce7671009834f3912f34f
parent60d38d308aa4b7dedb56c4326bb5c29b52c80090 (diff)
downloademacs-14324c4d46d7519a697e3d63df7d83c48ef90673.tar.gz
emacs-14324c4d46d7519a697e3d63df7d83c48ef90673.zip
(x-select-text): Always set the cut buffer,
but sometimes set it to nothing. Don't put large strings in clipboard.
-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."
491;;; from x-cut-buffer-or-selection-value. 491;;; from x-cut-buffer-or-selection-value.
492(defvar x-last-selected-text nil) 492(defvar x-last-selected-text nil)
493 493
494;;; It is said that overlarge strings are slow to put into the cut buffer,
495;;; and would crash the clipboard.
494(defvar x-cut-buffer-max 20000 496(defvar x-cut-buffer-max 20000
495 "Max number of characters to put in the cut buffer.") 497 "Max number of characters to put in the cut buffer or clipboard.")
496 498
497;;; Make TEXT, a string, the primary and clipboard X selections. 499;;; Make TEXT, a string, the primary and clipboard X selections.
498;;; If you are running xclipboard, this means you can effectively 500;;; 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."
503 ;; Don't send the cut buffer too much text. 505 ;; Don't send the cut buffer too much text.
504 ;; It becomes slow, and if really big it causes errors. 506 ;; It becomes slow, and if really big it causes errors.
505 (if (< (length text) x-cut-buffer-max) 507 (if (< (length text) x-cut-buffer-max)
506 (x-set-cut-buffer text push)) 508 (progn
507 (x-set-selection 'CLIPBOARD text) 509 (x-set-cut-buffer text push)
510 (x-set-selection 'CLIPBOARD text))
511 (x-set-cut-buffer "" push))
508 (x-set-selection 'PRIMARY text) 512 (x-set-selection 'PRIMARY text)
509 (setq x-last-selected-text text)) 513 (setq x-last-selected-text text))
510 514