From: Stefan Monnier Date: Mon, 8 Oct 2012 00:12:26 +0000 (-0400) Subject: * lisp/comint.el (comint-preinput-scroll-to-bottom): Preserve the X-Git-Tag: emacs-24.2.90~237^2~72 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5acd2b3ece740bbe487e9474f30665317db6f190;p=emacs.git * lisp/comint.el (comint-preinput-scroll-to-bottom): Preserve the frame-selected-windows. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0f896aa086..eaeca11ca09 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-08 Stefan Monnier + + * comint.el (comint-preinput-scroll-to-bottom): Preserve the + frame-selected-windows. + 2012-10-07 Stefan Monnier * subr.el (read-passwd-map): Don't use `defconst' (bug#12597). diff --git a/lisp/comint.el b/lisp/comint.el index 080b12e0cdf..cff9afee0df 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -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)