Bug 19699 - Mousewheel support in GNU emacs 20.7
Mousewheel support in GNU emacs 20.7
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: emacs (Show other bugs)
7.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
Aaron Brown
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-24 13:14 EDT by Omnifarious
Modified: 2007-04-18 12:29 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-10-24 15:11:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Omnifarious 2000-10-24 13:14:38 EDT
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.
Comment 1 Trond Eivind Glomsrxd 2000-10-24 15:11:45 EDT
I think adding mwheel.el is a better solution - I'll probably do that.
Comment 2 Trond Eivind Glomsrxd 2000-12-10 22:23:16 EST
Done, in emacs-20.7-22 and higher, coming soon to a Rawhide mirror near you.

Note You need to log in before you can comment on or make changes to this bug.