aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-09-07 13:30:50 +0000
committerGerd Moellmann2001-09-07 13:30:50 +0000
commitc9e74cd4be9caeb8c1b3d43f4f5b708184e9aa06 (patch)
tree4bd8d7936149b739ba503a44f209f956d623194e
parent70569550f7cb9673a9f0ef9a5815527f73eee253 (diff)
downloademacs-c9e74cd4be9caeb8c1b3d43f4f5b708184e9aa06.tar.gz
emacs-c9e74cd4be9caeb8c1b3d43f4f5b708184e9aa06.zip
(comint-send-input): Handle comint-process-echoes
differently.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/comint.el29
2 files changed, 31 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 249e46e06e8..239dd228879 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,10 +1,15 @@
12001-09-07 Dr Francis J. Wright <F.J.Wright@qmw.ac.uk>
2
3 * comint.el (comint-send-input): Handle comint-process-echoes
4 differently.
5
12001-09-07 Eli Zaretskii <eliz@is.elta.co.il> 62001-09-07 Eli Zaretskii <eliz@is.elta.co.il>
2 7
3 * arc-mode.el (archive-dostime): Fix a typo in minutes' 8 * arc-mode.el (archive-dostime): Fix a typo in minutes'
4 computation. 9 computation.
5 10
62001-09-07 Gerd Moellmann <gerd@gnu.org> 112001-09-07 Gerd Moellmann <gerd@gnu.org>
7 12
8 * server.el (server-switch-buffer): Use get-window-with-predicate. 13 * server.el (server-switch-buffer): Use get-window-with-predicate.
9 14
10 * textmodes/refer.el (refer-find-entry-internal): Use 15 * textmodes/refer.el (refer-find-entry-internal): Use
diff --git a/lisp/comint.el b/lisp/comint.el
index e93a9f956e7..24ffe55ed71 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1422,9 +1422,7 @@ Similarly for Soar, Scheme, etc."
1422 (delete-region pmark start) 1422 (delete-region pmark start)
1423 copy)))) 1423 copy))))
1424 1424
1425 (if comint-process-echoes 1425 (insert ?\n)
1426 (delete-region pmark (point))
1427 (insert ?\n))
1428 1426
1429 (comint-add-to-input-history history) 1427 (comint-add-to-input-history history)
1430 1428
@@ -1469,6 +1467,29 @@ Similarly for Soar, Scheme, etc."
1469 ;; clear the "accumulation" marker 1467 ;; clear the "accumulation" marker
1470 (set-marker comint-accum-marker nil) 1468 (set-marker comint-accum-marker nil)
1471 (funcall comint-input-sender proc input) 1469 (funcall comint-input-sender proc input)
1470
1471 ;; Optionally delete echoed input (after checking it).
1472 (if comint-process-echoes
1473 (let* ((echo-len (- comint-last-input-end
1474 comint-last-input-start))
1475 (echo-end (+ comint-last-input-end echo-len)))
1476 ;; Wait for all input to be echoed:
1477 (while (and (accept-process-output proc)
1478 (> echo-end (point-max))
1479 (= 0 (compare-buffer-substrings
1480 nil comint-last-input-start
1481 (- (point-max) echo-len)
1482 ;; Above difference is equivalent to
1483 ;; (+ comint-last-input-start
1484 ;; (- (point-max) comint-last-input-end))
1485 nil comint-last-input-end (point-max)))))
1486 (if (and
1487 (<= echo-end (point-max))
1488 (= 0 (compare-buffer-substrings
1489 nil comint-last-input-start comint-last-input-end
1490 nil comint-last-input-end echo-end)))
1491 (delete-region comint-last-input-end echo-end))))
1492
1472 ;; This used to call comint-output-filter-functions, 1493 ;; This used to call comint-output-filter-functions,
1473 ;; but that scrolled the buffer in undesirable ways. 1494 ;; but that scrolled the buffer in undesirable ways.
1474 (run-hook-with-args 'comint-output-filter-functions ""))))) 1495 (run-hook-with-args 'comint-output-filter-functions "")))))
@@ -1540,7 +1561,7 @@ This function should be in the list `comint-output-filter-functions'."
1540 (delete-char -2))))))))) 1561 (delete-char -2)))))))))
1541 1562
1542(add-hook 'comint-output-filter-functions 'comint-carriage-motion) 1563(add-hook 'comint-output-filter-functions 'comint-carriage-motion)
1543 1564
1544;; The purpose of using this filter for comint processes 1565;; The purpose of using this filter for comint processes
1545;; is to keep comint-last-input-end from moving forward 1566;; is to keep comint-last-input-end from moving forward
1546;; when output is inserted. 1567;; when output is inserted.