aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorNoam Postavsky2016-09-11 11:09:57 -0400
committerNoam Postavsky2017-02-02 21:20:29 -0500
commite27a91cddc1a66c25e09d3929c5625637ec34a49 (patch)
tree00096f2a38822f4c63ba228e769fb02c1c966b54 /doc
parentc92fc7a2156a5939439b7236452d4dfcfc13cc89 (diff)
downloademacs-e27a91cddc1a66c25e09d3929c5625637ec34a49.tar.gz
emacs-e27a91cddc1a66c25e09d3929c5625637ec34a49.zip
Make limit on scroll-margin variable
* src/xdisp.c (maximum-scroll-margin): New variable. * lisp/cus-start.el: Make it customizable. * etc/NEWS: Mention it. * doc/emacs/display.texi (Auto Scrolling): * doc/lispref/windows.texi (Textual Scrolling): Document it. * src/window.c (window_scroll_pixel_based): Use it instead of hardcoding division by 4 (Bug #5718).
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/display.texi12
-rw-r--r--doc/lispref/windows.texi15
2 files changed, 23 insertions, 4 deletions
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index c6e990d9082..15c700892bc 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -285,13 +285,17 @@ multiple variables, the order of priority is:
285@code{scroll-up-aggressively} / @code{scroll-down-aggressively}. 285@code{scroll-up-aggressively} / @code{scroll-down-aggressively}.
286 286
287@vindex scroll-margin 287@vindex scroll-margin
288@vindex maximum-scroll-margin
288 The variable @code{scroll-margin} restricts how close point can come 289 The variable @code{scroll-margin} restricts how close point can come
289to the top or bottom of a window (even if aggressive scrolling 290to the top or bottom of a window (even if aggressive scrolling
290specifies a fraction @var{f} that is larger than the window portion 291specifies a fraction @var{f} that is larger than the window portion
291between the top and the bottom margins). Its value is a number of screen 292between the top and the bottom margins). Its value is a number of
292lines; if point comes within that many lines of the top or bottom of 293screen lines; if point comes within that many lines of the top or
293the window, Emacs performs automatic scrolling. By default, 294bottom of the window, Emacs performs automatic scrolling. By default,
294@code{scroll-margin} is 0. 295@code{scroll-margin} is 0. The effective margin size is limited to a
296quarter of the window height by default, but this limit can be
297increased up to half (or decreased down to zero) by customizing
298@code{maximum-scroll-margin}.
295 299
296@node Horizontal Scrolling 300@node Horizontal Scrolling
297@section Horizontal Scrolling 301@section Horizontal Scrolling
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 6f3de0c8a0e..affa28c9202 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -3924,6 +3924,21 @@ redisplay scrolls the text automatically (if possible) to move point
3924out of the margin, closer to the center of the window. 3924out of the margin, closer to the center of the window.
3925@end defopt 3925@end defopt
3926 3926
3927@defopt maximum-scroll-margin
3928This variable limits the effective value of @code{scroll-margin} to a
3929fraction of the current window line height. For example, if the
3930current window has 20 lines and @code{maximum-scroll-margin} is 0.1,
3931then the scroll margins will never be larger than 2 lines, no matter
3932how big @code{scroll-margin} is.
3933
3934@code{maximum-scroll-margin} itself has a maximum value of 0.5, which
3935allows setting margins large to keep the cursor at the middle line of
3936the window (or two middle lines if the window has an even number of
3937lines). If it's set to a larger value (or any value other than a
3938float between 0.0 and 0.5) then the default value of 0.25 will be used
3939instead.
3940@end defopt
3941
3927@defopt scroll-conservatively 3942@defopt scroll-conservatively
3928This variable controls how scrolling is done automatically when point 3943This variable controls how scrolling is done automatically when point
3929moves off the screen (or into the scroll margin). If the value is a 3944moves off the screen (or into the scroll margin). If the value is a