aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/comint.el27
1 files changed, 2 insertions, 25 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 45325e7e4db..44b885593e2 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1416,31 +1416,8 @@ This function could be in the list `comint-output-filter-functions'."
1416 1416
1417;;; Low-level process communication 1417;;; Low-level process communication
1418 1418
1419(defvar comint-input-chunk-size 512 1419(defalias 'comint-send-string 'process-send-string)
1420 "*Long inputs are sent to comint processes in chunks of this size. 1420(defalias 'comint-send-region 'process-send-region)
1421If your process is choking on big inputs, try lowering the value.")
1422
1423(defun comint-send-string (proc str)
1424 "Send PROCESS the contents of STRING as input.
1425This is equivalent to `process-send-string', except that long input strings
1426are broken up into chunks of size `comint-input-chunk-size'. Processes
1427are given a chance to output between chunks. This can help prevent processes
1428from hanging when you send them long inputs on some OS's."
1429 (let* ((len (length str))
1430 (i (min len comint-input-chunk-size)))
1431 (process-send-string proc (substring str 0 i))
1432 (while (< i len)
1433 (let ((next-i (+ i comint-input-chunk-size)))
1434 (accept-process-output)
1435 (sit-for 0)
1436 (process-send-string proc (substring str i (min len next-i)))
1437 (setq i next-i)))))
1438
1439(defun comint-send-region (proc start end)
1440 "Sends to PROC the region delimited by START and END.
1441This is a replacement for `process-send-region' that tries to keep
1442your process from hanging on long inputs. See `comint-send-string'."
1443 (comint-send-string proc (buffer-substring start end)))
1444 1421
1445;;; Random input hackage 1422;;; Random input hackage
1446 1423