How can I make Emacs mouse scrolling slower and smoother?

Headcrab picture Headcrab · Jan 15, 2009 · Viewed 15.8k times · Source

When I scroll in Emacs using mouse wheel, it scrolls 5 lines at a time, which, I think, is way too much - where do I set a new value?

Also, when I scroll in Emacs with a mouse (either wheel or scrollbar), the cursor jumps to stay inside the visible screen area - is there a way to override that behavior, making it staying on the line it was on, even when it goes out of screen? In other words, I don't want the position where newly typed symbols appear changed by the scrolling.

Any alternative suggestion on how I could peek into some remote section of code and then quickly return to the former position is also welcome.

Answer

luapyad picture luapyad · Jan 15, 2009

You can control the amount in variable mouse-wheel-scroll-amount (in mwheel.el).

EDIT: E.g. Add (setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control) . nil))) to your .emacs for 1 line at a time.

I also have (setq mouse-wheel-progressive-speed nil) in my .emacs which I think is nicer behaviour.