summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-11-10 00:25:30 +0000
committerRichard M. Stallman <rms@gnu.org>1996-11-10 00:25:30 +0000
commitc23fc555f654a995a6404f71d5aa2b1f482b3094 (patch)
tree5c494ed8ef0fe66ec3842c5d8776d96c4141c8b8 /src
parentc7bbfc2e018add466ff484c97a004a6d44d3d76e (diff)
downloademacs-c23fc555f654a995a6404f71d5aa2b1f482b3094.tar.gz
(redisplay_window): Handle optional_new_start.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 5787a2e6668..7151877a6f8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1582,6 +1582,27 @@ redisplay_window (window, just_this_one, preserve_echo_area)
startp = marker_position (w->start);
+ /* If someone specified a new starting point but did not insist,
+ check whether it can be used. */
+ if (!NILP (w->optional_new_start))
+ {
+ w->optional_new_start = Qnil;
+ /* Check whether this start pos is usable given where point is. */
+
+ pos = *compute_motion (startp, 0,
+ (((EQ (window, minibuf_window)
+ && startp == BEG)
+ ? minibuf_prompt_width : 0)
+ + (hscroll ? 1 - hscroll : 0)),
+ 0,
+ PT, height, 0,
+ width, hscroll, pos_tab_offset (w, startp), w);
+ /* If PT does fit on the screen, we will use this start pos,
+ so do so by setting force_start. */
+ if (pos.bufpos == PT)
+ w->force_start = Qt;
+ }
+
/* Handle case where place to start displaying has been specified,
unless the specified location is outside the accessible range. */
if (!NILP (w->force_start))