diff options
author | Eli Zaretskii <eliz@gnu.org> | 2019-04-06 11:22:13 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2019-04-06 11:22:13 +0300 |
commit | a30a6c3019ac09ede1cc47671083b2e9ecdbffdf (patch) | |
tree | 7ea60b51caf504fc472e4b83b3766935d5ed1535 /doc/lispref | |
parent | 92ce2dd48bd3f31b848f0258ad79af01a7197b44 (diff) | |
download | emacs-a30a6c3019ac09ede1cc47671083b2e9ecdbffdf.tar.gz |
Improve documentation of set-window-start
* doc/lispref/windows.texi (Window Start and End):
* src/window.c (Fset_window_start): Document that reliable
setting of a window start position requires to adjust point to
be visible. (Bug#34038)
Diffstat (limited to 'doc/lispref')
-rw-r--r-- | doc/lispref/windows.texi | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 27940e12c79..f4395c12d26 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -4625,13 +4625,14 @@ This function sets the display-start position of @var{window} to @var{position} in @var{window}'s buffer. It returns @var{position}. The display routines insist that the position of point be visible when a -buffer is displayed. Normally, they change the display-start position -(that is, scroll the window) whenever necessary to make point visible. -However, if you specify the start position with this function using -@code{nil} for @var{noforce}, it means you want display to start at -@var{position} even if that would put the location of point off the -screen. If this does place point off screen, the display routines move -point to the left margin on the middle line in the window. +buffer is displayed. Normally, they select the display-start position +according to their internal logic (and scroll the window if necessary) +to make point visible. However, if you specify the start position +with this function using @code{nil} for @var{noforce}, it means you +want display to start at @var{position} even if that would put the +location of point off the screen. If this does place point off +screen, the display routines attempt to move point to the left margin +on the middle line in the window. For example, if point @w{is 1} and you set the start of the window @w{to 37}, the start of the next line, point will be above the top @@ -4678,6 +4679,13 @@ it is still 1 when redisplay occurs. Here is an example: @end group @end example +If the attempt to make point visible (i.e., in a fully-visible screen +line) fails, the display routines will disregard the requested +window-start position and compute a new one anyway. Thus, for +reliable results Lisp programs that call this function should always +move point to be inside the window whose display starts at +@var{position}. + If @var{noforce} is non-@code{nil}, and @var{position} would place point off screen at the next redisplay, then redisplay computes a new window-start position that works well with point, and thus @var{position} is not used. |