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.