diff options
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/net/rcirc.el | 41 |
2 files changed, 33 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 70149334770..30cf80dc2ab 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2006-09-07 Ryan Yeske <rcyeske@gmail.com> | ||
| 2 | |||
| 3 | * net/rcirc.el (rcirc-scroll-show-maximum-output): Rename from | ||
| 4 | rcirc-show-maximum-output. | ||
| 5 | (rcirc-mode): Remove window-scroll-function hook. | ||
| 6 | (rcirc-scroll-to-bottom): Remove function. | ||
| 7 | (rcirc-print): Recenter so point stays at the bottom of the window | ||
| 8 | if point was already there. | ||
| 9 | |||
| 1 | 2006-09-12 Paul Eggert <eggert@cs.ucla.edu> | 10 | 2006-09-12 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 11 | ||
| 3 | * comint.el (comint-exec-1): Set EMACS to the full name of Emacs, | 12 | * comint.el (comint-exec-1): Set EMACS to the full name of Emacs, |
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 19712d2a716..12c86b8163f 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -142,7 +142,7 @@ number. If zero or nil, no truncating is done." | |||
| 142 | (integer :tag "Number of lines")) | 142 | (integer :tag "Number of lines")) |
| 143 | :group 'rcirc) | 143 | :group 'rcirc) |
| 144 | 144 | ||
| 145 | (defcustom rcirc-show-maximum-output t | 145 | (defcustom rcirc-scroll-show-maximum-output t |
| 146 | "*If non-nil, scroll buffer to keep the point at the bottom of | 146 | "*If non-nil, scroll buffer to keep the point at the bottom of |
| 147 | the window." | 147 | the window." |
| 148 | :type 'boolean | 148 | :type 'boolean |
| @@ -762,8 +762,6 @@ If NOTICEP is non-nil, send a notice instead of privmsg." | |||
| 762 | (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook nil t) | 762 | (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook nil t) |
| 763 | (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook nil t) | 763 | (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook nil t) |
| 764 | 764 | ||
| 765 | (add-hook 'window-scroll-functions 'rcirc-scroll-to-bottom nil t) | ||
| 766 | |||
| 767 | ;; add to buffer list, and update buffer abbrevs | 765 | ;; add to buffer list, and update buffer abbrevs |
| 768 | (when target ; skip server buffer | 766 | (when target ; skip server buffer |
| 769 | (let ((buffer (current-buffer))) | 767 | (let ((buffer (current-buffer))) |
| @@ -1166,14 +1164,6 @@ is found by looking up RESPONSE in `rcirc-response-formats'." | |||
| 1166 | (defvar rcirc-last-sender nil) | 1164 | (defvar rcirc-last-sender nil) |
| 1167 | (make-variable-buffer-local 'rcirc-last-sender) | 1165 | (make-variable-buffer-local 'rcirc-last-sender) |
| 1168 | 1166 | ||
| 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 | |||
| 1177 | (defun rcirc-print (process sender response target text &optional activity) | 1167 | (defun rcirc-print (process sender response target text &optional activity) |
| 1178 | "Print TEXT in the buffer associated with TARGET. | 1168 | "Print TEXT in the buffer associated with TARGET. |
| 1179 | Format based on SENDER and RESPONSE. If ACTIVITY is non-nil, | 1169 | Format based on SENDER and RESPONSE. If ACTIVITY is non-nil, |
| @@ -1252,17 +1242,34 @@ record activity." | |||
| 1252 | 1242 | ||
| 1253 | ;; set the window point for buffers show in windows | 1243 | ;; set the window point for buffers show in windows |
| 1254 | (walk-windows (lambda (w) | 1244 | (walk-windows (lambda (w) |
| 1255 | (unless (eq (selected-window) w) | 1245 | (when (and (not (eq (selected-window) w)) |
| 1256 | (when (and (eq (current-buffer) | 1246 | (eq (current-buffer) |
| 1257 | (window-buffer w)) | 1247 | (window-buffer w)) |
| 1258 | (>= (window-point w) | 1248 | (>= (window-point w) |
| 1259 | rcirc-prompt-end-marker)) | 1249 | rcirc-prompt-end-marker)) |
| 1260 | (set-window-point w (point-max))))) | 1250 | (set-window-point w (point-max)))) |
| 1261 | nil t) | 1251 | nil t) |
| 1262 | 1252 | ||
| 1263 | ;; restore the point | 1253 | ;; restore the point |
| 1264 | (goto-char (if moving rcirc-prompt-end-marker old-point)) | 1254 | (goto-char (if moving rcirc-prompt-end-marker old-point)) |
| 1265 | 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 | (- (line-number-at-pos | ||
| 1265 | (window-point)) | ||
| 1266 | (line-number-at-pos | ||
| 1267 | (window-start))) | ||
| 1268 | 1) | ||
| 1269 | 0) | ||
| 1270 | (recenter -1))))))) | ||
| 1271 | nil t)) | ||
| 1272 | |||
| 1266 | ;; flush undo (can we do something smarter here?) | 1273 | ;; flush undo (can we do something smarter here?) |
| 1267 | (buffer-disable-undo) | 1274 | (buffer-disable-undo) |
| 1268 | (buffer-enable-undo)) | 1275 | (buffer-enable-undo)) |