Using emacs-mac-port, and I'm trying to configure horizontal scrolling with the trackpad. The following expressions work if I execute them manually via eval-last-sexp,
(global-set-key [wheel-right] (lambda ()
(interactive)
(scroll-left 1)))
(global-set-key [wheel-left] (lambda ()
(interactive)
(scroll-right 1)))
but having added them to my init file seems to have no effect. I start up emacs, type a line long enough to be truncated, try to scroll sideways and I have no horizontal scroll. If I open up my init file (~/.emacs.d/init.el) and execute the relevant expressions manually, I DO get horizontal scrolling.
Some investigation shows that at initial startup, wheel-right and wheel-left are both bound to mac-mwheel-scroll, an interactive compiled Lisp function in Emacs.app/Contents/Resources/lisp/term/mac-win.el
which "parses switches controlling interface with Mac window system".
Interestingly, the mac-mwheel-scroll definition includes a comment: TODO: horizontal scrolling
How can I give the settings in my init file a higher precedence than what's being set in mac-win.el? I'm guessing mac-win.el is being read later in startup process and thus overriding my settings, but I'm not really sure about that.
C-h k
before scrolling sideways. This will tell you which function is actually being called. – nanny Jun 24 '15 at 13:29Emacs.app/Contents/Resources/lisp/term/mac-win.el
. I'll update the question. – ivan Jun 24 '15 at 13:39mac-win.el
on the web, it looks like turning offmac-mouse-wheel-mode
might help? – nanny Jun 24 '15 at 14:21