# HG changeset patch # User Karl Heuer # Date 762116899 0 # Node ID e40292d5c167579782a379fa2dec22038ce43629 # Parent 3426f36178e51e1a5e35691aa1c93d75d09c5d62 (sort_overlays): Allow for null window. diff -r 3426f36178e5 -r e40292d5c167 src/buffer.c --- a/src/buffer.c Thu Feb 24 18:06:41 1994 +0000 +++ b/src/buffer.c Thu Feb 24 19:08:19 1994 +0000 @@ -1422,34 +1422,34 @@ 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;