How can I use my trackpad to scroll left and right, when in horizontal-scroll-bar-mode?

I am running GNU Emacs 25.3.3 (x86_64-apple-darwin13.4.0, Carbon Version 157 AppKit 1265.21) of 2017-09-28.

This is the MacPorts edition by Mitsuharu Yamamoto.



Following the advice of @lawlist (below) I needed to first find out what actions my trackpad left/right swipe are currently bound to (if any). So I entered C-h k and then scrolled right with my track pad. Here is the message that came back:

<wheel-right> at that spot runs the command mac-mwheel-scroll (found
in global-map), which is an interactive compiled Lisp function in

It is bound to <C-wheel-right>, <S-wheel-right>, <wheel-right>,
<C-wheel-left>, <S-wheel-left>, <wheel-left>, <C-wheel-down>,
<S-wheel-down>, <wheel-down>, <C-wheel-up>, <S-wheel-up>, <wheel-up>.

(mac-mwheel-scroll EVENT)

Scroll up or down according to the EVENT.
Mostly like ‘mwheel-scroll’, but try scrolling by pixel unit if
EVENT has no modifier keys, ‘mac-mouse-wheel-smooth-scroll’ is
non-nil, and the input device supports it.
  • Is there a certain swiping gesture that you make where Emacs does something else, or instead generates a message stating that your gesture is undefined? If it is defined to something, then you can first type C-h k and then the gesture to see what function it is assigned to. If it is not defined, you can look in the *Messages* buffer and see what key it is and then subsequently you can assign any function to that gesture. Since there are so many gestures and different versions of OSX, it may help if you be really specific regarding what OS version and answers to the above tests. – lawlist Jun 23 '18 at 15:48
  • Thanks @lawlist. I am running 10.11.6 (El Capitan). I opened the Messages buffer and tried swiping left/right with my magic mouse. But it no messages are generated. Up/down works fine though... – Adam Jun 23 '18 at 18:08
  • Based upon your comment above, we now know that your mouse gestures are not generating any messages as keys being undefined. However, we still do not know what Emacs functions are presently assigned to those keys (mouse gestures) given your particular setup. The reason we do not know this, is because you have apparently not yet typed C-h k and made your mouse gestures (in each direction) and then updated your question with the results of those tests. – lawlist Jun 23 '18 at 23:10
  • Ah, sorry. Missed the first part of your comment. Please see above, thanks. – Adam Jun 24 '18 at 5:58
  • It looks like you are using a modified version of Emacs by Mitsuharu Yamamoto: bitbucket.org/mituharu/emacs-mac/overview -- mac-mwheel-scroll is defined in mac-win.el, which is a library that is not included in the vanilla version of Emacs. It may behoove you to add that Emacs version information to your question so that someone who has that version, or is willing to install that version, can help you further. – lawlist Jun 24 '18 at 6:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.