noinput
noinput

Reputation: 411

How to prevent Emacs from scrolling with the mouse past the end of the buffer?

The default behavior is that Emacs keeps scrolling the last line to the center of the frame. How can I keep the last line at the bottom of the frame when I scroll using the mouse?

Upvotes: 2

Views: 987

Answers (1)

lawlist
lawlist

Reputation: 13447

(setq scroll-conservatively 101)

Here is the information from the *Help* window produced by describe-variable:

scroll-conservatively is a variable defined in `C source code'.
Its value is 101
Original value was 0

Documentation:
Scroll up to this many lines, to bring point back on screen.
If point moves off-screen, redisplay will scroll by up to
‘scroll-conservatively’ lines in order to bring point just barely
onto the screen again.  If that cannot be done, then redisplay
recenters point as usual.

If the value is greater than 100, redisplay will never recenter point,
but will always scroll just enough text to bring point into view, even
if you move far away.

A value of zero means always recenter point if it moves off screen.

You can customize this variable.

Upvotes: 1

Related Questions