diff options
author | Miles Bader <miles@gnu.org> | 2006-09-14 09:24:00 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2006-09-14 09:24:00 +0000 |
commit | 863153c57b164f79f030f34dba6953a3d0d60097 (patch) | |
tree | 85c2823f2a948b0d8757b6787cb059793581339a /lisp/net/rcirc.el | |
parent | fae22cbf7f66b7adc732e46a27b821114c812fdd (diff) | |
parent | f9536fb238209311e10468e4eb0fa2ac0a309816 (diff) | |
download | emacs-863153c57b164f79f030f34dba6953a3d0d60097.tar.gz emacs-863153c57b164f79f030f34dba6953a3d0d60097.tar.bz2 emacs-863153c57b164f79f030f34dba6953a3d0d60097.zip |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 427-436)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 134-136)
- Merge from emacs--devo--0
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-110
Diffstat (limited to 'lisp/net/rcirc.el')
-rw-r--r-- | lisp/net/rcirc.el | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 8c678b6ae5f..a639afeecf8 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -142,7 +142,7 @@ number. If zero or nil, no truncating is done." (integer :tag "Number of lines")) :group 'rcirc) -(defcustom rcirc-show-maximum-output t +(defcustom rcirc-scroll-show-maximum-output t "*If non-nil, scroll buffer to keep the point at the bottom of the window." :type 'boolean @@ -762,8 +762,6 @@ If NOTICEP is non-nil, send a notice instead of privmsg." (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook nil t) (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook nil t) - (add-hook 'window-scroll-functions 'rcirc-scroll-to-bottom nil t) - ;; add to buffer list, and update buffer abbrevs (when target ; skip server buffer (let ((buffer (current-buffer))) @@ -1166,14 +1164,6 @@ is found by looking up RESPONSE in `rcirc-response-formats'." (defvar rcirc-last-sender nil) (make-variable-buffer-local 'rcirc-last-sender) -(defun rcirc-scroll-to-bottom (window display-start) - "Scroll window to show maximum output if `rcirc-show-maximum-output' is -non-nil." - (when rcirc-show-maximum-output - (with-selected-window window - (when (>= (window-point) rcirc-prompt-end-marker) - (recenter -1))))) - (defun rcirc-print (process sender response target text &optional activity) "Print TEXT in the buffer associated with TARGET. Format based on SENDER and RESPONSE. If ACTIVITY is non-nil, @@ -1252,17 +1242,33 @@ record activity." ;; set the window point for buffers show in windows (walk-windows (lambda (w) - (unless (eq (selected-window) w) - (when (and (eq (current-buffer) - (window-buffer w)) - (>= (window-point w) - rcirc-prompt-end-marker)) - (set-window-point w (point-max))))) + (when (and (not (eq (selected-window) w)) + (eq (current-buffer) + (window-buffer w)) + (>= (window-point w) + rcirc-prompt-end-marker)) + (set-window-point w (point-max)))) nil t) ;; restore the point (goto-char (if moving rcirc-prompt-end-marker old-point)) + ;; 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)) + ;; flush undo (can we do something smarter here?) (buffer-disable-undo) (buffer-enable-undo)) @@ -1545,8 +1551,8 @@ activity. Only run if the buffer is not visible and (dolist (type rcirc-activity-types) (rcirc-add-face 0 (length s) (case type - ('nick 'rcirc-track-nick) - ('keyword 'rcirc-track-keyword)) + (nick 'rcirc-track-nick) + (keyword 'rcirc-track-keyword)) s))) s)) buffers ",")) |