aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorKarl Heuer1995-03-22 21:23:10 +0000
committerKarl Heuer1995-03-22 21:23:10 +0000
commitfc04fa47a486d7380b7fac90daa90b3cd091b011 (patch)
treeed230481a377c86a881c346ce2259a27b7bf64f1 /src/buffer.c
parent15874c5958f2480f3d77617b229734536830de42 (diff)
downloademacs-fc04fa47a486d7380b7fac90daa90b3cd091b011.tar.gz
emacs-fc04fa47a486d7380b7fac90daa90b3cd091b011.zip
(overlay_touches_p): New function.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 71ab0daaee3..96f2e56ec6e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1631,6 +1631,47 @@ overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr)
1631 *prev_ptr = prev; 1631 *prev_ptr = prev;
1632 return idx; 1632 return idx;
1633} 1633}
1634
1635/* Fast function to just test if we're at an overlay boundary. */
1636int
1637overlay_touches_p (pos)
1638 int pos;
1639{
1640 Lisp_Object tail, overlay;
1641
1642 for (tail = current_buffer->overlays_before; GC_CONSP (tail);
1643 tail = XCONS (tail)->cdr)
1644 {
1645 int endpos;
1646
1647 overlay = XCONS (tail)->car;
1648 if (!GC_OVERLAYP (overlay))
1649 abort ();
1650
1651 endpos = OVERLAY_POSITION (OVERLAY_END (overlay));
1652 if (endpos < pos)
1653 break;
1654 if (endpos == pos || OVERLAY_POSITION (OVERLAY_START (overlay)) == pos)
1655 return 1;
1656 }
1657
1658 for (tail = current_buffer->overlays_after; GC_CONSP (tail);
1659 tail = XCONS (tail)->cdr)
1660 {
1661 int startpos;
1662
1663 overlay = XCONS (tail)->car;
1664 if (!GC_OVERLAYP (overlay))
1665 abort ();
1666
1667 startpos = OVERLAY_POSITION (OVERLAY_START (overlay));
1668 if (pos < startpos)
1669 break;
1670 if (startpos == pos || OVERLAY_POSITION (OVERLAY_END (overlay)) == pos)
1671 return 1;
1672 }
1673 return 0;
1674}
1634 1675
1635struct sortvec 1676struct sortvec
1636{ 1677{