From: npostavs@users.sourceforge.net
To: Eli Zaretskii <eliz@gnu.org>
Cc: ahyatt@gmail.com, 5718@debbugs.gnu.org, gavenkoa@gmail.com
Subject: bug#5718: scroll-margin in buffer with small line count.
Date: Mon, 30 Jan 2017 23:52:22 -0500 [thread overview]
Message-ID: <87bmunrfuh.fsf@users.sourceforge.net> (raw)
In-Reply-To: <834m0gy3ah.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Jan 2017 17:29:26 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: npostavs@users.sourceforge.net
>> Cc: 5718@debbugs.gnu.org, ahyatt@gmail.com, gavenkoa@gmail.com
>> Date: Sat, 28 Jan 2017 19:57:21 -0500
>>
>> Okay, I think this is ready now, I'm posting the final patchset for
>> reference. It's basically the same as the previous stuff, but I've made
>> maximum-scroll-margin customizable, and renamed window-tests.el to
>> test/manual/scroll-tests.el (since it only works in an interactive
>> session).
>>
>> I'll push to master in a couple of days.
>
> Thanks, it LGTM. Would you mind to mention the new option in the user
> manual?
Oh right, forgot about that. Does this look okay?
diff --git c/doc/emacs/display.texi i/doc/emacs/display.texi
index c6e990d..4c4d696 100644
--- c/doc/emacs/display.texi
+++ i/doc/emacs/display.texi
@@ -285,13 +285,17 @@ Auto Scrolling
@code{scroll-up-aggressively} / @code{scroll-down-aggressively}.
@vindex scroll-margin
+@vindex maximum-scroll-margin
The variable @code{scroll-margin} restricts how close point can come
to the top or bottom of a window (even if aggressive scrolling
specifies a fraction @var{f} that is larger than the window portion
between the top and the bottom margins). Its value is a number of screen
lines; if point comes within that many lines of the top or bottom of
the window, Emacs performs automatic scrolling. By default,
-@code{scroll-margin} is 0.
+@code{scroll-margin} is 0. The effective margin size is limited to a
+quarter of the window height by default, but this limit can be
+increased up to half (or decreased down to zero) by customizing
+@code{maximum-scroll-margin}.
@node Horizontal Scrolling
@section Horizontal Scrolling
diff --git c/doc/lispref/windows.texi i/doc/lispref/windows.texi
index 6f3de0c..affa28c 100644
--- c/doc/lispref/windows.texi
+++ i/doc/lispref/windows.texi
@@ -3924,6 +3924,21 @@ Textual Scrolling
out of the margin, closer to the center of the window.
@end defopt
+@defopt maximum-scroll-margin
+This variable limits the effective value of @code{scroll-margin} to a
+fraction of the current window line height. For example, if the
+current window has 20 lines and @code{maximum-scroll-margin} is 0.1,
+then the scroll margins will never be larger than 2 lines, no matter
+how big @code{scroll-margin} is.
+
+@code{maximum-scroll-margin} itself has a maximum value of 0.5, which
+allows setting margins large to keep the cursor at the middle line of
+the window (or two middle lines if the window has an even number of
+lines). If it's set to a larger value (or any value other than a
+float between 0.0 and 0.5) then the default value of 0.25 will be used
+instead.
+@end defopt
+
@defopt scroll-conservatively
This variable controls how scrolling is done automatically when point
moves off the screen (or into the scroll margin). If the value is a
next prev parent reply other threads:[~2017-01-31 4:52 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-14 17:26 bug#5718: scroll-margin in buffer with small line count Oleksandr Gavenko
2016-08-11 4:11 ` Andrew Hyatt
2016-08-11 12:03 ` npostavs
2016-08-11 13:05 ` Oleksandr Gavenko
2016-08-11 13:24 ` Noam Postavsky
2016-08-12 7:54 ` Oleksandr Gavenko
2016-08-11 15:28 ` Eli Zaretskii
2016-08-13 22:01 ` npostavs
2016-08-14 2:36 ` Eli Zaretskii
2016-09-11 20:58 ` npostavs
2016-09-12 6:19 ` martin rudalics
2016-09-14 2:23 ` npostavs
2016-09-14 5:30 ` martin rudalics
2016-09-12 17:36 ` Eli Zaretskii
2016-09-14 2:40 ` npostavs
2016-09-14 17:26 ` Eli Zaretskii
2017-01-03 0:48 ` npostavs
2017-01-07 8:17 ` Eli Zaretskii
2017-01-14 4:18 ` npostavs
2017-01-14 7:58 ` Eli Zaretskii
2017-01-15 21:43 ` npostavs
2017-01-16 17:08 ` Eli Zaretskii
2017-01-21 18:46 ` npostavs
2017-01-21 19:17 ` Eli Zaretskii
2017-01-22 17:21 ` npostavs
2017-01-22 17:58 ` Eli Zaretskii
2017-01-29 0:57 ` npostavs
2017-01-30 15:29 ` Eli Zaretskii
2017-01-31 4:52 ` npostavs [this message]
2017-01-31 15:33 ` Eli Zaretskii
2017-02-03 2:40 ` npostavs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bmunrfuh.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=5718@debbugs.gnu.org \
--cc=ahyatt@gmail.com \
--cc=eliz@gnu.org \
--cc=gavenkoa@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.