changeset 61637:54eea2db9773

(overlay_arrow_string_or_property): Remove PBITMAP arg. Calls changed. Don't check for overlay-arrow-bitmap property here. (overlay_arrow_at_row): Remove PBITMAP arg. Instead, if left fringe is present, return Lisp integer for bitmap (or -1 for default). Fix value of overlay-arrow-bitmap property to be a symbol, use lookup_fringe_bitmap to parse it. (display_line): Change call to overlay_arrow_at_row. Store integer return value as overlay bitmap in row rather than window. Only show overlay arrow if row displays text, or if no other overlay arrow is seen in window (if overlay marker is at point-max).
author Kim F. Storm <storm@cua.dk>
date Mon, 18 Apr 2005 14:10:09 +0000
parents fe8f5f0fe1ca
children ef63bf685348
files src/xdisp.c
diffstat 1 files changed, 29 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Mon Apr 18 14:09:56 2005 +0000
+++ b/src/xdisp.c	Mon Apr 18 14:10:09 2005 +0000
@@ -9643,22 +9643,14 @@
 
 
 static Lisp_Object
-overlay_arrow_string_or_property (var, pbitmap)
+overlay_arrow_string_or_property (var)
      Lisp_Object var;
-     int *pbitmap;
-{
-  Lisp_Object pstr = Fget (var, Qoverlay_arrow_string);
-  Lisp_Object bitmap;
-
-  if (pbitmap)
-    {
-      *pbitmap = 0;
-      if (bitmap  = Fget (var, Qoverlay_arrow_bitmap), INTEGERP (bitmap))
-	*pbitmap = XINT (bitmap);
-    }
-
-  if (!NILP (pstr))
-    return pstr;
+{
+  Lisp_Object val;
+
+  if (val = Fget (var, Qoverlay_arrow_string), STRINGP (val))
+    return val;
+
   return Voverlay_arrow_string;
 }
 
@@ -9708,7 +9700,7 @@
 	continue;
       if (! EQ (COERCE_MARKER (val),
 		Fget (var, Qlast_arrow_position))
-	  || ! (pstr = overlay_arrow_string_or_property (var, 0),
+	  || ! (pstr = overlay_arrow_string_or_property (var),
 		EQ (pstr, Fget (var, Qlast_arrow_string))))
 	return 1;
     }
@@ -9738,7 +9730,7 @@
 	  Fput (var, Qlast_arrow_position,
 		COERCE_MARKER (val));
 	  Fput (var, Qlast_arrow_string,
-		overlay_arrow_string_or_property (var, 0));
+		overlay_arrow_string_or_property (var));
 	}
       else if (up_to_date < 0
 	       || !NILP (Fget (var, Qlast_arrow_position)))
@@ -9751,14 +9743,13 @@
 
 
 /* Return overlay arrow string to display at row.
-   Return t if display as bitmap in left fringe.
+   Return integer (bitmap number) for arrow bitmap in left fringe.
    Return nil if no overlay arrow.  */
 
 static Lisp_Object
-overlay_arrow_at_row (it, row, pbitmap)
+overlay_arrow_at_row (it, row)
      struct it *it;
      struct glyph_row *row;
-     int *pbitmap;
 {
   Lisp_Object vlist;
 
@@ -9778,17 +9769,21 @@
 	  && current_buffer == XMARKER (val)->buffer
 	  && (MATRIX_ROW_START_CHARPOS (row) == marker_position (val)))
 	{
-	  val = overlay_arrow_string_or_property (var, pbitmap);
 	  if (FRAME_WINDOW_P (it->f)
 	      && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0)
-	    return Qt;
-	  if (STRINGP (val))
-	    return val;
-	  break;
-	}
-    }
-
-  *pbitmap = 0;
+	    {
+	      if (val = Fget (var, Qoverlay_arrow_bitmap), SYMBOLP (val))
+		{
+		  int fringe_bitmap;
+		  if ((fringe_bitmap = lookup_fringe_bitmap (val)) != 0)
+		    return make_number (fringe_bitmap);
+		}
+	      return make_number (-1); /* Use default arrow bitmap */
+	    }
+	  return overlay_arrow_string_or_property (var);
+	}
+    }
+
   return Qnil;
 }
 
@@ -14846,7 +14841,6 @@
      struct it *it;
 {
   struct glyph_row *row = it->glyph_row;
-  int overlay_arrow_bitmap;
   Lisp_Object overlay_arrow_string;
 
   /* We always start displaying at hpos zero even if hscrolled.  */
@@ -15254,9 +15248,9 @@
      mark this glyph row as the one containing the overlay arrow.
      This is clearly a mess with variable size fonts.  It would be
      better to let it be displayed like cursors under X.  */
-  if ((overlay_arrow_string
-       = overlay_arrow_at_row (it, row, &overlay_arrow_bitmap),
-       !NILP (overlay_arrow_string)))
+  if ((row->displays_text_p || !overlay_arrow_seen)
+      && (overlay_arrow_string = overlay_arrow_at_row (it, row),
+	  !NILP (overlay_arrow_string)))
     {
       /* Overlay arrow in window redisplay is a fringe bitmap.  */
       if (STRINGP (overlay_arrow_string))
@@ -15286,8 +15280,8 @@
 	}
       else
 	{
-	  it->w->overlay_arrow_bitmap = overlay_arrow_bitmap;
-	  row->overlay_arrow_p = 1;
+	  xassert (INTEGERP (overlay_arrow_string));
+	  row->overlay_arrow_bitmap = XINT (overlay_arrow_string);
 	}
       overlay_arrow_seen = 1;
     }