diff options
author | Deniz Dogan <deniz@dogan.se> | 2011-09-03 19:40:08 +0200 |
---|---|---|
committer | Deniz Dogan <deniz@dogan.se> | 2011-09-03 19:40:08 +0200 |
commit | d37e5c877713210af39d81a7cf80335b79eae820 (patch) | |
tree | d8cb87821dfbfef3963e7498157103e5c0abc6f2 /lisp/net/rcirc.el | |
parent | f3ada0eeb5a6011eafa45bdce9abea5db46d4939 (diff) | |
download | emacs-d37e5c877713210af39d81a7cf80335b79eae820.tar.gz emacs-d37e5c877713210af39d81a7cf80335b79eae820.tar.bz2 emacs-d37e5c877713210af39d81a7cf80335b79eae820.zip |
* lisp/net/rcirc.el (rcirc-print): Simplify code for rcirc-scroll-show-maximum-output. There is no need to walk through all windows to find the right one.
Diffstat (limited to 'lisp/net/rcirc.el')
-rw-r--r-- | lisp/net/rcirc.el | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 71b3fe0c4a1..06bbfb0b78c 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -1556,18 +1556,16 @@ record activity." ;; keep window on bottom line if it was already there (when rcirc-scroll-show-maximum-output - (walk-windows (lambda (w) - (when (eq (window-buffer w) (current-buffer)) - (with-current-buffer (window-buffer w) - (when (eq major-mode 'rcirc-mode) - (with-selected-window w - (when (<= (- (window-height) - (count-screen-lines (window-point) - (window-start)) - 1) - 0) - (recenter -1))))))) - nil t)) + (let ((window (get-buffer-window))) + (when window + (with-selected-window window + (when (eq major-mode 'rcirc-mode) + (when (<= (- (window-height) + (count-screen-lines (window-point) + (window-start)) + 1) + 0) + (recenter -1))))))) ;; flush undo (can we do something smarter here?) (buffer-disable-undo) |