changeset 16554:f930574421d9

(redisplay_window): Handle optional_new_start.
author Richard M. Stallman <rms@gnu.org>
date Sun, 10 Nov 1996 00:25:30 +0000
parents 39aa8dd49637
children 6aea522a93c7
files src/xdisp.c
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Sun Nov 10 00:25:20 1996 +0000
+++ b/src/xdisp.c	Sun Nov 10 00:25:30 1996 +0000
@@ -1582,6 +1582,27 @@
 
   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))