简体   繁体   中英

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?

(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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM