Here is some code that could be added to mouse.el to accomplish this: --------------------------------------------------------- (defcustom mouse-wheel-distance 10 "*Number of lines, maximum, to scroll the window when you move the mouse wheel." :type 'integer :group 'mouse) ;-------------------------- (defun mouse-wheelscroll-down () " A function to scroll up or down in response to the mouse wheel." (interactive) (scroll-down (min mouse-wheel-distance (max 1 (- (window-height) next-screen-context-lines))))) ;-------------------------- (defun mouse-wheelscroll-up () " A function to scroll up or down in response to the mouse wheel." (interactive) (scroll-up (min mouse-wheel-distance (max 1 (- (window-height) next-screen-context-lines))))) (global-set-key [mouse-4] (function mouse-wheelscroll-down)) (global-set-key [mouse-5] (function mouse-wheelscroll-up)) --------------------------------------------------------- Perhaps it would be better to use a scaling factor against (window-height) rather than an absolute distance for mouse-wheel-distance.
I think adding mwheel.el is a better solution - I'll probably do that.
Done, in emacs-20.7-22 and higher, coming soon to a Rawhide mirror near you.