diff options
| author | Noam Postavsky | 2016-09-11 11:09:57 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-02-02 21:20:29 -0500 |
| commit | e27a91cddc1a66c25e09d3929c5625637ec34a49 (patch) | |
| tree | 00096f2a38822f4c63ba228e769fb02c1c966b54 /doc | |
| parent | c92fc7a2156a5939439b7236452d4dfcfc13cc89 (diff) | |
| download | emacs-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.texi | 12 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 15 |
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 |
| 289 | to the top or bottom of a window (even if aggressive scrolling | 290 | to the top or bottom of a window (even if aggressive scrolling |
| 290 | specifies a fraction @var{f} that is larger than the window portion | 291 | specifies a fraction @var{f} that is larger than the window portion |
| 291 | between the top and the bottom margins). Its value is a number of screen | 292 | between the top and the bottom margins). Its value is a number of |
| 292 | lines; if point comes within that many lines of the top or bottom of | 293 | screen lines; if point comes within that many lines of the top or |
| 293 | the window, Emacs performs automatic scrolling. By default, | 294 | bottom 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 |
| 296 | quarter of the window height by default, but this limit can be | ||
| 297 | increased 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 | |||
| 3924 | out of the margin, closer to the center of the window. | 3924 | out of the margin, closer to the center of the window. |
| 3925 | @end defopt | 3925 | @end defopt |
| 3926 | 3926 | ||
| 3927 | @defopt maximum-scroll-margin | ||
| 3928 | This variable limits the effective value of @code{scroll-margin} to a | ||
| 3929 | fraction of the current window line height. For example, if the | ||
| 3930 | current window has 20 lines and @code{maximum-scroll-margin} is 0.1, | ||
| 3931 | then the scroll margins will never be larger than 2 lines, no matter | ||
| 3932 | how big @code{scroll-margin} is. | ||
| 3933 | |||
| 3934 | @code{maximum-scroll-margin} itself has a maximum value of 0.5, which | ||
| 3935 | allows setting margins large to keep the cursor at the middle line of | ||
| 3936 | the window (or two middle lines if the window has an even number of | ||
| 3937 | lines). If it's set to a larger value (or any value other than a | ||
| 3938 | float between 0.0 and 0.5) then the default value of 0.25 will be used | ||
| 3939 | instead. | ||
| 3940 | @end defopt | ||
| 3941 | |||
| 3927 | @defopt scroll-conservatively | 3942 | @defopt scroll-conservatively |
| 3928 | This variable controls how scrolling is done automatically when point | 3943 | This variable controls how scrolling is done automatically when point |
| 3929 | moves off the screen (or into the scroll margin). If the value is a | 3944 | moves off the screen (or into the scroll margin). If the value is a |