]> git.eshelyaron.com Git - emacs.git/commitdiff
(sort_overlays): Allow for null window.
authorKarl Heuer <kwzh@gnu.org>
Thu, 24 Feb 1994 19:08:19 +0000 (19:08 +0000)
committerKarl Heuer <kwzh@gnu.org>
Thu, 24 Feb 1994 19:08:19 +0000 (19:08 +0000)
src/buffer.c

index 2f21a7b133f293655ddcb290141a99a43aaf2aa7..b9f699436f04cc009328900febc44b807a5e453b 100644 (file)
@@ -1422,34 +1422,34 @@ sort_overlays (overlay_vec, noverlays, w)
 
   for (i = 0, j = 0; i < noverlays; i++)
     {
+      Lisp_Object tem;
       Lisp_Object overlay = overlay_vec[i];
 
       if (OVERLAY_VALID (overlay)
          && OVERLAY_POSITION (OVERLAY_START (overlay)) > 0
          && OVERLAY_POSITION (OVERLAY_END (overlay)) > 0)
        {
-         Lisp_Object window;
-         window = Foverlay_get (overlay, Qwindow);
-
-         /* Also ignore overlays limited to one window
-            if it's not the window we are using.  */
-         if (XTYPE (window) != Lisp_Window
-             || XWINDOW (window) == w)
+         /* If we're interested in a specific window, then ignore
+            overlays that are limited to some other window.  */
+         if (w)
            {
-             Lisp_Object tem;
-
-             /* This overlay is good and counts:
-                put it in sortvec.  */
-             sortvec[j].overlay = overlay;
-             sortvec[j].beg = OVERLAY_POSITION (OVERLAY_START (overlay));
-             sortvec[j].end = OVERLAY_POSITION (OVERLAY_END (overlay));
-             tem = Foverlay_get (overlay, Qpriority);
-             if (INTEGERP (tem))
-               sortvec[j].priority = XINT (tem);
-             else
-               sortvec[j].priority = 0;
-             j++;
+             Lisp_Object window;
+
+             window = Foverlay_get (overlay, Qwindow);
+             if (XTYPE (window) == Lisp_Window && XWINDOW (window) != w)
+               continue;
            }
+
+         /* This overlay is good and counts: put it into sortvec.  */
+         sortvec[j].overlay = overlay;
+         sortvec[j].beg = OVERLAY_POSITION (OVERLAY_START (overlay));
+         sortvec[j].end = OVERLAY_POSITION (OVERLAY_END (overlay));
+         tem = Foverlay_get (overlay, Qpriority);
+         if (INTEGERP (tem))
+           sortvec[j].priority = XINT (tem);
+         else
+           sortvec[j].priority = 0;
+         j++;
        }
     }
   noverlays = j;