aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2001-09-11 08:43:02 +0000
committerMiles Bader2001-09-11 08:43:02 +0000
commit4e1513b5948ef2d160e2b648e95dc6ce28221474 (patch)
treed64efd1ee23fc54d0826d4d1650406e4906d2280
parent9a72e4c14b88be7510cda4a18daf58176585f80b (diff)
downloademacs-4e1513b5948ef2d160e2b648e95dc6ce28221474.tar.gz
emacs-4e1513b5948ef2d160e2b648e95dc6ce28221474.zip
(comint-send-input): When waiting for echoed input, don't save the
expected end position in `echo-end', so that things work properly even if the buffer is modified elsewhere at the same time [this happens if `comint-truncate-buffer' is used].
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/comint.el45
2 files changed, 32 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9436d6bb49b..1292cc2cfbf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12001-09-11 Miles Bader <miles@gnu.org>
2
3 * comint.el (comint-send-input): When waiting for echoed input,
4 don't save the expected end position in `echo-end', so that things
5 work properly even if the buffer is modified elsewhere at the same
6 time [this happens if `comint-truncate-buffer' is used].
7
12001-09-11 Gerd Moellmann <gerd@gnu.org> 82001-09-11 Gerd Moellmann <gerd@gnu.org>
2 9
3 * textmodes/outline.el (outline-mode): Use `^' and a shy group 10 * textmodes/outline.el (outline-mode): Use `^' and a shy group
diff --git a/lisp/comint.el b/lisp/comint.el
index 24ffe55ed71..71d0cae28ea 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1469,26 +1469,31 @@ Similarly for Soar, Scheme, etc."
1469 (funcall comint-input-sender proc input) 1469 (funcall comint-input-sender proc input)
1470 1470
1471 ;; Optionally delete echoed input (after checking it). 1471 ;; Optionally delete echoed input (after checking it).
1472 (if comint-process-echoes 1472 (when comint-process-echoes
1473 (let* ((echo-len (- comint-last-input-end 1473 (let ((echo-len (- comint-last-input-end
1474 comint-last-input-start)) 1474 comint-last-input-start)))
1475 (echo-end (+ comint-last-input-end echo-len))) 1475 ;; Wait for all input to be echoed:
1476 ;; Wait for all input to be echoed: 1476 (while (and (accept-process-output proc)
1477 (while (and (accept-process-output proc) 1477 (> (+ comint-last-input-end echo-len)
1478 (> echo-end (point-max)) 1478 (point-max))
1479 (= 0 (compare-buffer-substrings 1479 (zerop
1480 nil comint-last-input-start 1480 (compare-buffer-substrings
1481 (- (point-max) echo-len) 1481 nil comint-last-input-start
1482 ;; Above difference is equivalent to 1482 (- (point-max) echo-len)
1483 ;; (+ comint-last-input-start 1483 ;; Above difference is equivalent to
1484 ;; (- (point-max) comint-last-input-end)) 1484 ;; (+ comint-last-input-start
1485 nil comint-last-input-end (point-max))))) 1485 ;; (- (point-max) comint-last-input-end))
1486 (if (and 1486 nil comint-last-input-end (point-max)))))
1487 (<= echo-end (point-max)) 1487 (if (and
1488 (= 0 (compare-buffer-substrings 1488 (<= (+ comint-last-input-end echo-len)
1489 nil comint-last-input-start comint-last-input-end 1489 (point-max))
1490 nil comint-last-input-end echo-end))) 1490 (zerop
1491 (delete-region comint-last-input-end echo-end)))) 1491 (compare-buffer-substrings
1492 nil comint-last-input-start comint-last-input-end
1493 nil comint-last-input-end
1494 (+ comint-last-input-end echo-len))))
1495 (delete-region comint-last-input-end
1496 (+ comint-last-input-end echo-len)))))
1492 1497
1493 ;; This used to call comint-output-filter-functions, 1498 ;; This used to call comint-output-filter-functions,
1494 ;; but that scrolled the buffer in undesirable ways. 1499 ;; but that scrolled the buffer in undesirable ways.