Variable: scroll-conservatively
scroll-conservatively is a customizable variable defined in xdisp.c.
Value
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.
Probably introduced at or before Emacs version 20.1.
Source Code
// Defined in /usr/src/emacs/src/xdisp.c
DEFVAR_INT ("scroll-conservatively", scroll_conservatively,
doc: /* 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. */);