Show
Ignore:
Timestamp:
05/13/06 11:31:18 (3 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

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

    r4037 r4079  
    205205    (unwind-protect 
    206206        (let ((button (mwheel-event-button event))) 
    207           (cond ((eq button mouse-wheel-down-event) (scroll-down amt)) 
    208                 ((eq button mouse-wheel-up-event) (scroll-up amt)) 
     207          (cond ((eq button mouse-wheel-down-event) 
     208                 (condition-case nil (scroll-down amt) 
     209                   ;; Make sure we do indeed scroll to the beginning of 
     210                   ;; the buffer. 
     211                   (beginning-of-buffer 
     212                    (unwind-protect 
     213                        (scroll-down) 
     214                      ;; If the first scroll succeeded, then some scrolling 
     215                      ;; is possible: keep scrolling til the beginning but 
     216                      ;; do not signal an error.  For some reason, we have 
     217                      ;; to do it even if the first scroll signalled an 
     218                      ;; error, because otherwise the window is recentered 
     219                      ;; for a reason that escapes me.  This problem seems 
     220                      ;; to only affect scroll-down.  --Stef 
     221                      (set-window-start (selected-window) (point-min)))))) 
     222                ((eq button mouse-wheel-up-event) 
     223                 (condition-case nil (scroll-up amt) 
     224                   ;; Make sure we do indeed scroll to the end of the buffer. 
     225                   (end-of-buffer (while t (scroll-up))))) 
    209226                (t (error "Bad binding in mwheel-scroll")))) 
    210227      (if curwin (select-window curwin))))