0

How to silence GNU Emacs on MacOS with magic mouse? Forever getting the bell and messages telling me certain mouse wheel features are undefined when hovering in certain places. For example

<vertical-scroll-bar> <wheel-left> is undefined
<vertical-scroll-bar> <double-wheel-left> is undefined
<vertical-scroll-bar> <triple-wheel-left> is undefined [30 times]

1 Answer 1

1

The answer is similar as for any other key, assign it to a function that does nothing. Except one assigns the location and direction combination, for example:

 (global-set-key (kbd "<vertical-scroll-bar> <wheel-left>") #'ignore)

As there are a number of locations and direction combinations a nested while loop helps.

(let ((areas '("mode-line" "left-fringe" "right-fringe" "header-line" "vertical-scroll-bar"))
        (directions '("up" "down" "left" "right"))
        (counts '("" "double-" "tripple-"))
        loc direction count)
    (while areas
      (setq loc (pop areas))
      (setq direction directions)
      (while direction
        (setq dir (pop direction))
        (setq count counts)
        (while count
          (global-set-key
           (kbd (concat "<" loc "> <" (pop count) "wheel-" dir ">")) #'ignore)))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.