changeset 4236:8e14db210975

(x-select-text): Limit size of text sent to cut buffer.
author Richard M. Stallman <rms@gnu.org>
date Fri, 23 Jul 1993 01:43:39 +0000
parents 55182207415d
children 589ab12dbe3d
files lisp/term/x-win.el
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/x-win.el	Thu Jul 22 22:28:36 1993 +0000
+++ b/lisp/term/x-win.el	Fri Jul 23 01:43:39 1993 +0000
@@ -491,13 +491,19 @@
 ;;; from x-cut-buffer-or-selection-value.
 (defvar x-last-selected-text nil)
 
+(defvar x-cut-buffer-max 20000
+  "Max number of characters to put in the cut buffer.")
+
 ;;; Make TEXT, a string, the primary and clipboard X selections.
 ;;; If you are running xclipboard, this means you can effectively
 ;;; have a window on a copy of the kill-ring.
 ;;; Also, set the value of X cut buffer 0, for backward compatibility
 ;;; with older X applications.
 (defun x-select-text (text &optional push)
-  (x-set-cut-buffer text push)
+  ;; 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)
   (x-set-selection 'PRIMARY text)
   (setq x-last-selected-text text))