+ {
+ 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 (NILP (window) || XWINDOW (window) == 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++;
+ }
+ }