]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't invert wheel event directions
authorPo Lu <luangruo@yahoo.com>
Sun, 21 Jan 2024 04:47:24 +0000 (12:47 +0800)
committerEshel Yaron <me@eshelyaron.com>
Sun, 21 Jan 2024 07:31:55 +0000 (08:31 +0100)
* lisp/mwheel.el (mwheel--is-dir-p): In Emacs, up means down and
down means up...

(cherry picked from commit 957b4f826a440d3d6fae8e338667530713ddf0ba)

lisp/mwheel.el

index d3cdab87e8476c98446444cdf6b5e2efab352f80..1e08328c8751467a79e63c7d64825aec23c60b3b 100644 (file)
@@ -261,7 +261,15 @@ active window."
 (defmacro mwheel--is-dir-p (dir button)
   (declare (debug (sexp form)))
   (let ((custom-var (intern (format "mouse-wheel-%s-event" dir)))
-        (event (intern (format "wheel-%s" dir))))
+        ;; N.B. that the direction `down' in a wheel event refers to
+        ;; the movement of the section of the buffer the window is
+        ;; displaying, that is to say, the direction `scroll-up' moves
+        ;; it in.
+        (event (intern (format "wheel-%s" (cond ((eq dir 'up)
+                                                 'down)
+                                                ((eq dir 'down)
+                                                 'up)
+                                                (t dir))))))
     (macroexp-let2 nil butsym button
       `(or (eq ,butsym ',event)
            ;; We presume here `button' is never nil.