diff options
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/comint.el | 34 |
2 files changed, 29 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4b43050ddf5..03122ff5000 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-12-27 Vitalie Spinu <spinuvit@gmail.com> (tiny change) | ||
| 2 | |||
| 3 | * comint.el (comint-adjust-window-point): New function. | ||
| 4 | (comint-postoutput-scroll-to-bottom): Call | ||
| 5 | comint-adjust-window-point (Bug#13248). | ||
| 6 | |||
| 1 | 2012-12-26 Dmitry Gutov <dgutov@yandex.ru> | 7 | 2012-12-26 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 8 | ||
| 3 | * progmodes/ruby-mode.el (auto-mode-alist): `purecopy' the | 9 | * progmodes/ruby-mode.el (auto-mode-alist): `purecopy' the |
diff --git a/lisp/comint.el b/lisp/comint.el index a01e7e58cd7..f3450e3f58e 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -2120,19 +2120,31 @@ This function should be in the list `comint-output-filter-functions'." | |||
| 2120 | ((bound-and-true-p follow-mode) | 2120 | ((bound-and-true-p follow-mode) |
| 2121 | (follow-comint-scroll-to-bottom)) | 2121 | (follow-comint-scroll-to-bottom)) |
| 2122 | (t | 2122 | (t |
| 2123 | (let ((selected (selected-window))) | 2123 | (dolist (w (get-buffer-window-list current nil t)) |
| 2124 | (dolist (w (get-buffer-window-list current nil t)) | 2124 | (comint-adjust-window-point w process) |
| 2125 | (select-window w) | 2125 | ;; Optionally scroll to the bottom of the window. |
| 2126 | (unwind-protect | 2126 | (and comint-scroll-show-maximum-output |
| 2127 | (progn | 2127 | (eq (window-point w) (point-max)) |
| 2128 | (comint-adjust-point selected) | 2128 | (with-selected-window w |
| 2129 | ;; Optionally scroll to the bottom of the window. | 2129 | (recenter (- -1 scroll-margin))))))) |
| 2130 | (and comint-scroll-show-maximum-output | ||
| 2131 | (eobp) | ||
| 2132 | (recenter (- -1 scroll-margin)))) | ||
| 2133 | (select-window selected)))))) | ||
| 2134 | (set-buffer current)))) | 2130 | (set-buffer current)))) |
| 2135 | 2131 | ||
| 2132 | |||
| 2133 | (defun comint-adjust-window-point (window process) | ||
| 2134 | "Move point in WINDOW based on Comint settings. | ||
| 2135 | For point adjustment use the process-mark of PROCESS." | ||
| 2136 | (and (< (window-point window) (process-mark process)) | ||
| 2137 | (or (memq comint-move-point-for-output '(t all)) | ||
| 2138 | ;; Maybe user wants point to jump to end. | ||
| 2139 | (eq comint-move-point-for-output | ||
| 2140 | (if (eq (selected-window) window) 'this 'others)) | ||
| 2141 | ;; If point was at the end, keep it at end. | ||
| 2142 | (and (marker-position comint-last-output-start) | ||
| 2143 | (>= (window-point window) comint-last-output-start))) | ||
| 2144 | (set-window-point window (process-mark process)))) | ||
| 2145 | |||
| 2146 | |||
| 2147 | ;; this function is nowhere used | ||
| 2136 | (defun comint-adjust-point (selected) | 2148 | (defun comint-adjust-point (selected) |
| 2137 | "Move point in the selected window based on Comint settings. | 2149 | "Move point in the selected window based on Comint settings. |
| 2138 | SELECTED is the window that was originally selected." | 2150 | SELECTED is the window that was originally selected." |