| 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))))) |
|---|