diff options
author | Richard M. Stallman <rms@gnu.org> | 1999-07-09 02:32:02 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1999-07-09 02:32:02 +0000 |
commit | 0e7dd343a60735806a0febbe45dee399f588162d (patch) | |
tree | 4cd39566037a5390d9d519e21798664e67da0b2c /lisp | |
parent | d0eeaabb47ba24f35994e3cec5e153440238883c (diff) | |
download | emacs-0e7dd343a60735806a0febbe45dee399f588162d.tar.gz |
(term-emulate-terminal): Avoid infinite loop
in strange case where minibuffer window is selected but not active.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/term.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/term.el b/lisp/term.el index ac6201c8b33..262686cf9f2 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -2700,6 +2700,7 @@ See `term-prompt-regexp'." (let* ((previous-buffer (current-buffer)) (i 0) char funny count save-point save-marker old-point temp win (selected (selected-window)) + last-win (str-length (length str))) (unwind-protect (progn @@ -2957,6 +2958,11 @@ See `term-prompt-regexp'." ;; Scroll each window displaying the buffer but (by default) ;; only if the point matches the process-mark we started with. (setq win selected) + ;; Avoid infinite loop in strange case where minibuffer window + ;; is selected but not active. + (while (window-minibuffer-p win) + (setq win (next-window win nil t))) + (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) @@ -2982,7 +2988,7 @@ See `term-prompt-regexp'." (save-excursion (goto-char (point-max)) (recenter -1))))) - (not (eq win selected)))) + (not (eq win last-win)))) ;;; Stolen from comint.el and adapted -mm (if (> term-buffer-maximum-size 0) |