aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-05-01 22:00:16 +0800
committerChong Yidong2012-05-01 22:00:16 +0800
commit87233a14e07a61981e3ce51350efb8b7ee5adcd2 (patch)
tree14a8b741405ff84235334fc5f483ae891d5168ad
parent782fbf2a338e61231655e76b1727790374e02ca1 (diff)
downloademacs-87233a14e07a61981e3ce51350efb8b7ee5adcd2.tar.gz
emacs-87233a14e07a61981e3ce51350efb8b7ee5adcd2.zip
Fix mouse wheel scrolling in Follow mode.
* lisp/follow.el (follow-mwheel-scroll): New function. (follow-redraw-after-event): Fix last change. Fixes: debbugs:4112
-rw-r--r--lisp/ChangeLog1
-rw-r--r--lisp/follow.el18
2 files changed, 14 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 31fda48df48..cb7e1377c92 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -27,6 +27,7 @@
27 (follow-scroll-bar-toolkit-scroll, follow-scroll-bar-drag) 27 (follow-scroll-bar-toolkit-scroll, follow-scroll-bar-drag)
28 (follow-scroll-bar-scroll-up, follow-scroll-bar-scroll-down): New 28 (follow-scroll-bar-scroll-up, follow-scroll-bar-scroll-down): New
29 functions, replacing advice on scroll-bar-* commands. 29 functions, replacing advice on scroll-bar-* commands.
30 (follow-mwheel-scroll): New function (Bug#4112).
30 31
31 * comint.el (comint-adjust-point): New function. 32 * comint.el (comint-adjust-point): New function.
32 (comint-postoutput-scroll-to-bottom): Use it. Call 33 (comint-postoutput-scroll-to-bottom): Use it. Call
diff --git a/lisp/follow.el b/lisp/follow.el
index 53dd4c2c354..4c76b43da2d 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -258,6 +258,7 @@ After that, changing the prefix key requires manipulating keymaps."
258 (define-key mainmap [remap scroll-bar-drag] 'follow-scroll-bar-drag) 258 (define-key mainmap [remap scroll-bar-drag] 'follow-scroll-bar-drag)
259 (define-key mainmap [remap scroll-bar-scroll-up] 'follow-scroll-bar-scroll-up) 259 (define-key mainmap [remap scroll-bar-scroll-up] 'follow-scroll-bar-scroll-up)
260 (define-key mainmap [remap scroll-bar-scroll-down] 'follow-scroll-bar-scroll-down) 260 (define-key mainmap [remap scroll-bar-scroll-down] 'follow-scroll-bar-scroll-down)
261 (define-key mainmap [remap mwheel-scroll] 'follow-mwheel-scroll)
261 262
262 mainmap) 263 mainmap)
263 "Minor mode keymap for Follow mode.") 264 "Minor mode keymap for Follow mode.")
@@ -1315,17 +1316,24 @@ non-first windows in Follow mode."
1315 (scroll-bar-scroll-down event) 1316 (scroll-bar-scroll-down event)
1316 (follow-redraw-after-event event)) 1317 (follow-redraw-after-event event))
1317 1318
1319(defun follow-mwheel-scroll (event)
1320 (interactive "e")
1321 (mwheel-scroll event)
1322 (follow-redraw-after-event event))
1323
1318(defun follow-redraw-after-event (event) 1324(defun follow-redraw-after-event (event)
1319 "Re-align the Follow mode windows acted on by EVENT." 1325 "Re-align the Follow mode windows affected by EVENT."
1320 (let ((window (nth 0 (event-end event))) 1326 (let* ((window (nth 0 (event-end event)))
1321 (orig-win (selected-window))) 1327 (buffer (window-buffer window))
1322 (when (and (buffer-local-value 'follow-mode (window-buffer window)) 1328 (orig-win (selected-window)))
1329 (when (and (buffer-local-value 'follow-mode buffer)
1323 ;; Ignore the case where we scroll the selected window; 1330 ;; Ignore the case where we scroll the selected window;
1324 ;; that is handled by the post-command hook function. 1331 ;; that is handled by the post-command hook function.
1325 (not (eq window (selected-window)))) 1332 (not (eq window (selected-window))))
1326 (select-window window) 1333 (select-window window)
1327 (follow-redisplay) 1334 (follow-redisplay)
1328 (select-window orig-win)))) 1335 (unless (eq (window-buffer orig-win) buffer)
1336 (select-window orig-win)))))
1329 1337
1330;;; Window size change 1338;;; Window size change
1331 1339