]> git.eshelyaron.com Git - emacs.git/commitdiff
(comint-send-input): When waiting for echoed input, don't save the
authorMiles Bader <miles@gnu.org>
Tue, 11 Sep 2001 08:43:02 +0000 (08:43 +0000)
committerMiles Bader <miles@gnu.org>
Tue, 11 Sep 2001 08:43:02 +0000 (08:43 +0000)
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].

lisp/ChangeLog
lisp/comint.el

index 9436d6bb49bc7b0ed36d2efdfda278926716ebac..1292cc2cfbf9db28fe93818703d0edcfe2eae669 100644 (file)
@@ -1,3 +1,10 @@
+2001-09-11  Miles Bader  <miles@gnu.org>
+
+       * comint.el (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].
+
 2001-09-11  Gerd Moellmann  <gerd@gnu.org>
 
        * textmodes/outline.el (outline-mode): Use `^' and a shy group
index 24ffe55ed7112c05a846eb3e4337c62b72ea8588..71d0cae28eaa3493f11832904094ecf98c7924f3 100644 (file)
@@ -1469,26 +1469,31 @@ Similarly for Soar, Scheme, etc."
          (funcall comint-input-sender proc input)
 
          ;; Optionally delete echoed input (after checking it).
-         (if comint-process-echoes
-             (let* ((echo-len (- comint-last-input-end
-                                 comint-last-input-start))
-                    (echo-end (+ comint-last-input-end echo-len)))
-               ;; Wait for all input to be echoed:
-               (while (and (accept-process-output proc)
-                           (> echo-end (point-max))
-                           (= 0 (compare-buffer-substrings
-                                 nil comint-last-input-start
-                                 (- (point-max) echo-len)
-                                 ;; Above difference is equivalent to
-                                 ;; (+ comint-last-input-start
-                                 ;;    (- (point-max) comint-last-input-end))
-                                 nil comint-last-input-end (point-max)))))
-               (if (and
-                    (<= echo-end (point-max))
-                    (= 0 (compare-buffer-substrings
-                          nil comint-last-input-start comint-last-input-end
-                          nil comint-last-input-end echo-end)))
-                   (delete-region comint-last-input-end echo-end))))
+         (when comint-process-echoes
+           (let ((echo-len (- comint-last-input-end
+                              comint-last-input-start)))
+             ;; Wait for all input to be echoed:
+             (while (and (accept-process-output proc)
+                         (> (+ comint-last-input-end echo-len)
+                            (point-max))
+                         (zerop
+                          (compare-buffer-substrings
+                           nil comint-last-input-start
+                           (- (point-max) echo-len)
+                           ;; Above difference is equivalent to
+                           ;; (+ comint-last-input-start
+                           ;;    (- (point-max) comint-last-input-end))
+                           nil comint-last-input-end (point-max)))))
+             (if (and
+                  (<= (+ comint-last-input-end echo-len)
+                      (point-max))
+                  (zerop
+                   (compare-buffer-substrings
+                    nil comint-last-input-start comint-last-input-end
+                    nil comint-last-input-end
+                    (+ comint-last-input-end echo-len))))
+                 (delete-region comint-last-input-end
+                                (+ comint-last-input-end echo-len)))))
 
          ;; This used to call comint-output-filter-functions,
          ;; but that scrolled the buffer in undesirable ways.