Alex Rivera | Logout

How can I make Emacs mouse scrolling slower and smoother?

Asked 2009-01-15T06:49:51.333
56

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.

Edit
Report

3 Answers

2

It's impossible to have 'point' to exist somewhere outside of the current view; all the point movement commands move the display as well. I think that's a fundamental assumption that emacs makes.

I think what you want in your last point - to peek to a remote section and return - can be accomplished with registers:

This saves your position in register A:

C-x r A

And this restores the position from register A:

C-x r j A

If you do this a lot I'd advise binding those to things slightly less verbose :)

answered 2009-01-15T07:25:28.063
2

You can use some bookmark solution or the register, but also the build-in mark and the mark-ring -

(default binding) 

C-Space to set mark (push a mark in mark ring)
C-u C-Space to pop a mark off the ring; repeat this a few more time should 
            get you where you like to be

or if you don't have highlight region on or you don't mind seeing the highlighting,

C-x C-x (exchange-point-and-mark) switch between you current point and your previous mark.
answered 2009-01-15T14:50:43.967
2

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.

Ch 3 of Bob Glickstein's "Writing GNU Emacs Extensions" builds an unscroll-function (to return to a specified location in a scroll-command stack) as an programming example.

The code appears on-line, but there is a reported conflict with the ECB, if you use that.

answered 2009-01-15T20:53:51.660

Your Answer