summaryrefslogtreecommitdiff
path: root/lisp/mwheel.el
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2020-09-02 22:54:47 +0200
committerStefan Kangas <stefankangas@gmail.com>2020-09-02 22:57:24 +0200
commit77a5b696bbb4f70e23e94c8a731168a6673c8cd9 (patch)
treef6eb8bad74f8ec909fae3497ebc8839dc4f6c349 /lisp/mwheel.el
parent5aa5c0372dc3cccf2676d26a17b4d5f71caf8cdc (diff)
downloademacs-77a5b696bbb4f70e23e94c8a731168a6673c8cd9.tar.gz
emacs-77a5b696bbb4f70e23e94c8a731168a6673c8cd9.tar.bz2
emacs-77a5b696bbb4f70e23e94c8a731168a6673c8cd9.zip
Fix binding mouse wheel with modifiers in buffer area
* test/lisp/mwheel-tests.el (mwheel-test--create-scroll-keys): Fix binding mouse wheel with modifiers in buffer area, while ignoring them for fringes, margins, etc. My previous change mistakenly ignored all modifiers in `mouse-wheel-scroll-amount'. * lisp/mwheel.el (mouse-wheel--create-scroll-keys): Fix test to reflect the above.
Diffstat (limited to 'lisp/mwheel.el')
-rw-r--r--lisp/mwheel.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/mwheel.el b/lisp/mwheel.el
index d5172ba0bf5..53a5a50bada 100644
--- a/lisp/mwheel.el
+++ b/lisp/mwheel.el
@@ -363,8 +363,11 @@ an event used for scrolling, such as `mouse-wheel-down-event'."
'left-fringe 'right-fringe
'vertical-scroll-bar 'horizontal-scroll-bar
'mode-line 'header-line)))
- (cons (vector event) ; default case: no prefix.
- (when (not (consp binding))
+ (if (consp binding)
+ ;; With modifiers, bind only the buffer area (no prefix).
+ (list `[(,@(car binding) ,event)])
+ ;; No modifier: bind also some non-buffer areas of the screen.
+ (cons (vector event)
(mapcar (lambda (prefix) (vector prefix event)) prefixes)))))
(define-minor-mode mouse-wheel-mode