Mercurial > emacs
comparison src/buffer.c @ 6061:e40292d5c167
(sort_overlays): Allow for null window.
| author | Karl Heuer <kwzh@gnu.org> |
|---|---|
| date | Thu, 24 Feb 1994 19:08:19 +0000 |
| parents | 0b144d967f30 |
| children | 16fdee72722b |
comparison
equal
deleted
inserted
replaced
| 6060:3426f36178e5 | 6061:e40292d5c167 |
|---|---|
| 1420 | 1420 |
| 1421 /* Put the valid and relevant overlays into sortvec. */ | 1421 /* Put the valid and relevant overlays into sortvec. */ |
| 1422 | 1422 |
| 1423 for (i = 0, j = 0; i < noverlays; i++) | 1423 for (i = 0, j = 0; i < noverlays; i++) |
| 1424 { | 1424 { |
| 1425 Lisp_Object tem; | |
| 1425 Lisp_Object overlay = overlay_vec[i]; | 1426 Lisp_Object overlay = overlay_vec[i]; |
| 1426 | 1427 |
| 1427 if (OVERLAY_VALID (overlay) | 1428 if (OVERLAY_VALID (overlay) |
| 1428 && OVERLAY_POSITION (OVERLAY_START (overlay)) > 0 | 1429 && OVERLAY_POSITION (OVERLAY_START (overlay)) > 0 |
| 1429 && OVERLAY_POSITION (OVERLAY_END (overlay)) > 0) | 1430 && OVERLAY_POSITION (OVERLAY_END (overlay)) > 0) |
| 1430 { | 1431 { |
| 1431 Lisp_Object window; | 1432 /* If we're interested in a specific window, then ignore |
| 1432 window = Foverlay_get (overlay, Qwindow); | 1433 overlays that are limited to some other window. */ |
| 1433 | 1434 if (w) |
| 1434 /* Also ignore overlays limited to one window | |
| 1435 if it's not the window we are using. */ | |
| 1436 if (XTYPE (window) != Lisp_Window | |
| 1437 || XWINDOW (window) == w) | |
| 1438 { | 1435 { |
| 1439 Lisp_Object tem; | 1436 Lisp_Object window; |
| 1440 | 1437 |
| 1441 /* This overlay is good and counts: | 1438 window = Foverlay_get (overlay, Qwindow); |
| 1442 put it in sortvec. */ | 1439 if (XTYPE (window) == Lisp_Window && XWINDOW (window) != w) |
| 1443 sortvec[j].overlay = overlay; | 1440 continue; |
| 1444 sortvec[j].beg = OVERLAY_POSITION (OVERLAY_START (overlay)); | |
| 1445 sortvec[j].end = OVERLAY_POSITION (OVERLAY_END (overlay)); | |
| 1446 tem = Foverlay_get (overlay, Qpriority); | |
| 1447 if (INTEGERP (tem)) | |
| 1448 sortvec[j].priority = XINT (tem); | |
| 1449 else | |
| 1450 sortvec[j].priority = 0; | |
| 1451 j++; | |
| 1452 } | 1441 } |
| 1442 | |
| 1443 /* This overlay is good and counts: put it into sortvec. */ | |
| 1444 sortvec[j].overlay = overlay; | |
| 1445 sortvec[j].beg = OVERLAY_POSITION (OVERLAY_START (overlay)); | |
| 1446 sortvec[j].end = OVERLAY_POSITION (OVERLAY_END (overlay)); | |
| 1447 tem = Foverlay_get (overlay, Qpriority); | |
| 1448 if (INTEGERP (tem)) | |
| 1449 sortvec[j].priority = XINT (tem); | |
| 1450 else | |
| 1451 sortvec[j].priority = 0; | |
| 1452 j++; | |
| 1453 } | 1453 } |
| 1454 } | 1454 } |
| 1455 noverlays = j; | 1455 noverlays = j; |
| 1456 | 1456 |
| 1457 /* Sort the overlays into the proper order: increasing priority. */ | 1457 /* Sort the overlays into the proper order: increasing priority. */ |
