changeset 19375:83132785cf7f

(COERCE_MARKER): Use Fmarker_position instead of marker_position so that it works with a marker that points nowhere. (redisplay_window): Check that Voverlay_arrow_position is a marker before accessing it as such.
author Richard M. Stallman <rms@gnu.org>
date Sat, 16 Aug 1997 02:06:18 +0000
parents b4eb3242ba6e
children 6d5536cedd70
files src/xdisp.c
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Sat Aug 16 01:57:13 1997 +0000
+++ b/src/xdisp.c	Sat Aug 16 02:06:18 1997 +0000
@@ -251,7 +251,7 @@
 Lisp_Object Vmessage_log_max;
 
 #define COERCE_MARKER(X)	\
-  (MARKERP ((X)) ? make_number (marker_position (X)) : (X))
+  (MARKERP ((X)) ? Fmarker_position (X) : (X))
 
 /* Output a newline in the *Messages* buffer if "needs" one.  */
 
@@ -1835,13 +1835,14 @@
       && INTEGERP (w->window_end_vpos)
       && XFASTINT (w->window_end_vpos) < XFASTINT (w->height)
       && !EQ (window, minibuf_window)
-      && current_buffer != XMARKER (Voverlay_arrow_position)->buffer)
+      && (!MARKERP (Voverlay_arrow_position)
+	  || current_buffer != XMARKER (Voverlay_arrow_position)->buffer))
     {
+      /* All positions in this clause are relative to the window edge.  */
+
       int this_scroll_margin = scroll_margin;
       int last_point_y = XFASTINT (w->last_point_y) - XINT (w->top);
-      int last_point_x = (XFASTINT (w->last_point_x)
-			  + (hscroll ? 1 - hscroll : 0)
-			  - WINDOW_LEFT_MARGIN (w));
+      int last_point_x = (XFASTINT (w->last_point_x) - WINDOW_LEFT_MARGIN (w));
 
       /* Find where PT is located now on the frame.  */
       /* Check just_this_one as a way of verifying that the 
@@ -2915,7 +2916,6 @@
   XSETFASTINT (default_invis_vector[2], '.');
   default_invis_vector[0] = default_invis_vector[1] = default_invis_vector[2];
 
-  hpos += WINDOW_LEFT_MARGIN (w);
   get_display_line (f, vpos, WINDOW_LEFT_MARGIN (w));
   if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
 
@@ -2951,7 +2951,8 @@
 
 	  minibuf_prompt_width
 	    = (display_string (w, vpos, XSTRING (minibuf_prompt)->data,
-			       XSTRING (minibuf_prompt)->size, hpos,
+			       XSTRING (minibuf_prompt)->size,
+			       hpos + WINDOW_LEFT_MARGIN (w),
 			       /* Display a space if we truncate.  */
 			       ' ',
 			       1, -1,
@@ -2960,7 +2961,7 @@
 				  on the first line.  */
 			       (XFASTINT (w->width) > 10
 				? XFASTINT (w->width) - 4 : -1))
-	       - hpos);
+	       - hpos - WINDOW_LEFT_MARGIN (w));
 	  hpos += minibuf_prompt_width;
 	  taboffset -= minibuf_prompt_width - old_width;
 	}
@@ -3002,6 +3003,8 @@
         }
     }
 
+  hpos += WINDOW_LEFT_MARGIN (w);
+
   desired_glyphs->bufp[vpos] = start;
   p1 = desired_glyphs->glyphs[vpos] + hpos;
   p1start = p1;