Show
Ignore:
Timestamp:
09/18/06 20:48:14 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/net/rcirc.el

    r4161 r4166  
    143143  :group 'rcirc) 
    144144 
    145 (defcustom rcirc-show-maximum-output t 
     145(defcustom rcirc-scroll-show-maximum-output t 
    146146  "*If non-nil, scroll buffer to keep the point at the bottom of 
    147147the window." 
     
    762762  (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook nil t) 
    763763  (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook nil t) 
    764  
    765   (add-hook 'window-scroll-functions 'rcirc-scroll-to-bottom nil t) 
    766764 
    767765  ;; add to buffer list, and update buffer abbrevs 
     
    11671165(make-variable-buffer-local 'rcirc-last-sender) 
    11681166 
    1169 (defun rcirc-scroll-to-bottom (window display-start) 
    1170   "Scroll window to show maximum output if `rcirc-show-maximum-output' is 
    1171 non-nil." 
    1172   (when rcirc-show-maximum-output 
    1173     (with-selected-window window 
    1174       (when (>= (window-point) rcirc-prompt-end-marker) 
    1175         (recenter -1))))) 
    1176  
    11771167(defun rcirc-print (process sender response target text &optional activity) 
    11781168  "Print TEXT in the buffer associated with TARGET. 
     
    12531243          ;; set the window point for buffers show in windows 
    12541244          (walk-windows (lambda (w) 
    1255                           (unless (eq (selected-window) w
    1256                             (when (and (eq (current-buffer) 
    1257                                            (window-buffer w)) 
    1258                                        (>= (window-point w) 
    1259                                            rcirc-prompt-end-marker)) 
    1260                               (set-window-point w (point-max))))) 
     1245                          (when (and (not (eq (selected-window) w)
     1246                                    (eq (current-buffer) 
     1247                                         (window-buffer w)) 
     1248                                     (>= (window-point w) 
     1249                                         rcirc-prompt-end-marker)) 
     1250                            (set-window-point w (point-max)))) 
    12611251                        nil t) 
    12621252 
    12631253          ;; restore the point 
    12641254          (goto-char (if moving rcirc-prompt-end-marker old-point)) 
     1255 
     1256        ;; keep window on bottom line if it was already there 
     1257          (when rcirc-scroll-show-maximum-output 
     1258            (walk-windows (lambda (w) 
     1259                            (when (eq (window-buffer w) (current-buffer)) 
     1260                              (with-current-buffer (window-buffer w) 
     1261                                (when (eq major-mode 'rcirc-mode) 
     1262                                  (with-selected-window w 
     1263                                    (when (<= (- (window-height) 
     1264                                                 (count-screen-lines 
     1265                                                  (window-point) 
     1266                                                  (window-start)) 
     1267                                                 1) 
     1268                                              0) 
     1269                                      (recenter -1))))))) 
     1270                          nil t)) 
    12651271 
    12661272          ;; flush undo (can we do something smarter here?)