]> code.delx.au - gnu-emacs/commitdiff
* lisp/comint.el (comint-preinput-scroll-to-bottom): Preserve the
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 8 Oct 2012 00:12:26 +0000 (20:12 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 8 Oct 2012 00:12:26 +0000 (20:12 -0400)
frame-selected-windows.

lisp/ChangeLog
lisp/comint.el

index b0f896aa086d57bb32a361f8123abcf11f3f1c62..eaeca11ca093d467bdbb660b95b1f58570fef8f1 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * comint.el (comint-preinput-scroll-to-bottom): Preserve the
+       frame-selected-windows.
+
 2012-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * subr.el (read-passwd-map): Don't use `defconst' (bug#12597).
index 080b12e0cdf29a637564273dbe4883213fd817a4..cff9afee0dffa0c1096a47eb57e4d89b75f34e68 100644 (file)
@@ -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)