]> git.eshelyaron.com Git - emacs.git/commitdiff
(mwheel-scroll): Make sure that when scrolling multiple
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 8 May 2006 15:14:26 +0000 (15:14 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 8 May 2006 15:14:26 +0000 (15:14 +0000)
pages at a time, if we signal the end, we should indeed reach that end.

lisp/ChangeLog
lisp/mwheel.el

index 6d386b6b5c6e246f48fd064227a4e653cc2481f0..7437f4aed990c781c5a5c073ddeb023c7896a55d 100644 (file)
@@ -1,3 +1,13 @@
+2006-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * mwheel.el (mwheel-scroll): Make sure that when scrolling multiple
+       pages at a time, if we signal the end, we should indeed reach that end.
+
+2006-05-08  David Reitter  <david.reitter@gmail.com>
+
+       * emacs-lisp/easy-mmode.el (define-minor-mode): Only preserve messages
+       output during execution of the body.
+
 2006-05-08  Kim F. Storm  <storm@cua.dk>
 
        * progmodes/grep.el (lgrep, rgrep): Doc fixes.
index 662b992b3439e46b79b82693bfa45e259cc0fd92..b61971c7ea5f157b2c61378a27f38f11b2721a30 100644 (file)
@@ -204,8 +204,25 @@ This should only be bound to mouse buttons 4 and 5."
       (setq amt (* amt (event-click-count event))))
     (unwind-protect
        (let ((button (mwheel-event-button event)))
-         (cond ((eq button mouse-wheel-down-event) (scroll-down amt))
-               ((eq button mouse-wheel-up-event) (scroll-up amt))
+         (cond ((eq button mouse-wheel-down-event)
+                 (condition-case nil (scroll-down amt)
+                   ;; Make sure we do indeed scroll to the beginning of
+                   ;; the buffer.
+                   (beginning-of-buffer
+                    (unwind-protect
+                        (scroll-down)
+                      ;; If the first scroll succeeded, then some scrolling
+                      ;; is possible: keep scrolling til the beginning but
+                      ;; do not signal an error.  For some reason, we have
+                      ;; to do it even if the first scroll signalled an
+                      ;; error, because otherwise the window is recentered
+                      ;; for a reason that escapes me.  This problem seems
+                      ;; to only affect scroll-down.  --Stef
+                      (set-window-start (selected-window) (point-min))))))
+               ((eq button mouse-wheel-up-event)
+                 (condition-case nil (scroll-up amt)
+                   ;; Make sure we do indeed scroll to the end of the buffer.
+                   (end-of-buffer (while t (scroll-up)))))
                (t (error "Bad binding in mwheel-scroll"))))
       (if curwin (select-window curwin))))
   (when (and mouse-wheel-click-event mouse-wheel-inhibit-click-time)