(if (and (nth 4 event)
(zerop (window-hscroll window)))
(let ((delta (round (cdr (nth 4 event)))))
- (if (> (abs delta) (window-text-height window t))
- (mwheel-scroll event nil)
- (with-selected-window window
- (condition-case nil
- (if (< delta 0)
- (pixel-scroll-precision-scroll-down (- delta))
- (pixel-scroll-precision-scroll-up delta))
- ;; Do not ding at buffer limits. Show a message instead.
- (beginning-of-buffer
- (message (error-message-string '(beginning-of-buffer))))
- (end-of-buffer
- (message (error-message-string '(end-of-buffer))))))))
+ (unless (zerop delta)
+ (if (> (abs delta) (window-text-height window t))
+ (mwheel-scroll event nil)
+ (with-selected-window window
+ (condition-case nil
+ (if (< delta 0)
+ (pixel-scroll-precision-scroll-down (- delta))
+ (pixel-scroll-precision-scroll-up delta))
+ ;; Do not ding at buffer limits. Show a message instead.
+ (beginning-of-buffer
+ (message (error-message-string '(beginning-of-buffer))))
+ (end-of-buffer
+ (message (error-message-string '(end-of-buffer)))))))))
(mwheel-scroll event nil))))
;;;###autoload