changeset 55653:5b5102265ed8

(next_overlay_change, note_mouse_highlight): Use GET_OVERLAYS_AT.
author Kim F. Storm <storm@cua.dk>
date Mon, 17 May 2004 22:48:56 +0000
parents 2e649bd1c696
children edc2b57535e5
files src/xdisp.c
diffstat 1 files changed, 4 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Mon May 17 22:48:07 2004 +0000
+++ b/src/xdisp.c	Mon May 17 22:48:56 2004 +0000
@@ -2734,19 +2734,10 @@
   int noverlays;
   int endpos;
   Lisp_Object *overlays;
-  int len;
   int i;
 
   /* Get all overlays at the given position.  */
-  len = 10;
-  overlays = (Lisp_Object *) alloca (len * sizeof *overlays);
-  noverlays = overlays_at (pos, 0, &overlays, &len, &endpos, NULL, 1);
-  if (noverlays > len)
-    {
-      len = noverlays;
-      overlays = (Lisp_Object *) alloca (len * sizeof *overlays);
-      noverlays = overlays_at (pos, 0, &overlays, &len, &endpos, NULL, 1);
-    }
+  GET_OVERLAYS_AT (pos, overlays, noverlays, &endpos, 1);
 
   /* If any of these overlays ends before endpos,
      use its ending point instead.  */
@@ -20834,7 +20825,7 @@
       Lisp_Object object;
       Lisp_Object mouse_face = Qnil, overlay = Qnil, position;
       Lisp_Object *overlay_vec = NULL;
-      int len, noverlays;
+      int noverlays;
       struct buffer *obuf;
       int obegv, ozv, same_region;
 
@@ -20921,19 +20912,8 @@
 
       if (BUFFERP (object))
 	{
-	  /* Put all the overlays we want in a vector in overlay_vec.
-	     Store the length in len.  If there are more than 40, make
-	     enough space for all, and try again.  */
-	  len = 40;
-	  overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object));
-	  noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL, 0);
-	  if (noverlays > len)
-	    {
-	      len = noverlays;
-	      overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object));
-	      noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL,0);
-	    }
-
+	  /* Put all the overlays we want in a vector in overlay_vec.  */
+	  GET_OVERLAYS_AT (pos, overlay_vec, noverlays, NULL, 0);
 	  /* Sort overlays into increasing priority order.  */
 	  noverlays = sort_overlays (overlay_vec, noverlays, w);
 	}