X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/0aada74e88baf554a1bf95bce9373d9ac76429ad..db19bba331efadd37cec1298be2c28f0742a7379:/lisp/comint.el diff --git a/lisp/comint.el b/lisp/comint.el index 080b12e0cd..eda73af350 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1,6 +1,6 @@ ;;; comint.el --- general command interpreter in a window stuff -*- lexical-binding: t -*- -;; Copyright (C) 1988, 1990, 1992-2012 Free Software Foundation, Inc. +;; Copyright (C) 1988, 1990, 1992-2013 Free Software Foundation, Inc. ;; Author: Olin Shivers ;; Simon Marshall @@ -1847,9 +1847,9 @@ Similarly for Soar, Scheme, etc." (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) + (while (and (> (+ comint-last-input-end echo-len) (point-max)) + (accept-process-output proc) (zerop (compare-buffer-substrings nil comint-last-input-start @@ -2088,8 +2088,7 @@ This function should be a pre-command hook." (if (and comint-scroll-to-bottom-on-input (memq this-command '(self-insert-command comint-magic-space yank hilit-yank))) - (let* ((selected (selected-window)) - (current (current-buffer)) + (let* ((current (current-buffer)) (process (get-buffer-process current)) (scroll comint-scroll-to-bottom-on-input)) (if (and process (< (point) (process-mark process))) @@ -2099,10 +2098,8 @@ This function should be a pre-command hook." (lambda (window) (if (and (eq (window-buffer window) current) (or (eq scroll t) (eq scroll 'all))) - (progn - (select-window window) - (goto-char (point-max)) - (select-window selected)))) + (with-selected-window window + (goto-char (point-max))))) nil t)))))) (defvar follow-mode)