From 5acd2b3ece740bbe487e9474f30665317db6f190 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 7 Oct 2012 20:12:26 -0400 Subject: [PATCH] * lisp/comint.el (comint-preinput-scroll-to-bottom): Preserve the frame-selected-windows. --- lisp/ChangeLog | 5 +++++ lisp/comint.el | 9 +++------ 2 files changed, 8 insertions(+), 6 deletions(-) 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) -- 2.39.2