1

With GNU Emacs 26.1 installing either smooth scroll while adding

(require 'smooth-scroll)
(smooth-scroll-mode t)

to my .emacs, or smooth scrolling with

(require 'smooth-scrolling)
(smooth-scrolling-mode 1)

does turn on the smooth scrolling mode just fine, but two-finger vertical swipes on the trackpad do not deliver the purported smooth scrolling.

Switching to Yamamoto Mitsuharu's Emacs is a bit too much for just this one nice feature. I'd rather stick to a package.

Did you manage to get either of these two packages to smooth scroll with 26.1 or a recent version of Emacs?

By "smooth scroll" here I mean that one would get the scrolling obtained with, say, Safari (with files whose length exceeds that of the window/frame).

Update

The discussions online

are inherently confused. Missing in the middle of the questions/conversations is a definition of "line" in the expression "smooth scrolling by line". One solution is to qualify that term by replacing it with either "character-line" or "pixel-line". The present question is about the latter.

  • An implementation in Lisp of what could/should be done in C, is not going to be the best approach. To the extent that Mitsuharu does something better in C, then that would probably be better than vanilla Emacs with a Lisp attempted fix. If you are partial to staying with the vanilla Emacs, try (setq scroll-conservatively 101) and set the mouse / trackpad wheel scroll (within Emacs) to just one line at a time and try that. Forget about the other settings in the interim until you have fully explored that option, then play with other settings to your heart's content. You can type C-h v .. – lawlist Oct 2 '18 at 4:46
  • @lawlist Understood. But using C before even seeing whether the Lisp-side speed is adequate is a bit of premature optimization. The more critical issue is to see that it's doable at all using an elisp package. What API is Apple exposing? If that API is suitable, perhaps a modern CPU that is otherwise sitting idle will allow an Emacs buffer to scroll nicely. – Calaf Oct 2 '18 at 11:22
  • When you say that it should be like Safari, do you mean pixel scrolling, where it scrolls by less than the height of a line of text at a time? That's enabled with pixel-scroll-mode, though I don't know off-hand what events it responds to. It doesn't pixel scroll for page up or page down, for instance. smooth-scrolling-mode does subtly change the page up/page down behavior though, so perhaps you just need to be more precise about describing what you want? – db48x Oct 2 '18 at 15:52
  • @db48x Pretty simple, really. Start Emacs with no init file. Load a large text file. Double-swipe vertically. The bufer scrolls by pixel increments, not by text line (character) increments. It's much more pleasant on the eye, especially if you're going back and forth scrolling a program (yes, I'm aware of 'follow-mode' and split vertically, use a large screen, write brief blocks, etc... still..). – Calaf Oct 3 '18 at 23:48
  • That's not what the smooth-scrolling package does. You want to turn on pixel-scroll-mode instead. – db48x Oct 4 '18 at 7:26
1

M-x pixel-scroll-mode, available since Emacs 26, is all that's needed to have pixel scrolling. Credit to @db48x

Your Answer

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

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