From cf0df6ab1bfd10e29b9eee2a3c1f293f1b81a892 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 10 Nov 1996 00:25:30 +0000 Subject: [PATCH] (redisplay_window): Handle optional_new_start. --- src/xdisp.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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)) -- 2.39.5