aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h35
1 files changed, 1 insertions, 34 deletions
diff --git a/src/buffer.h b/src/buffer.h
index a4e3934cad2..288acd4f5ee 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1189,6 +1189,7 @@ extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t);
1189extern void mmap_set_vars (bool); 1189extern void mmap_set_vars (bool);
1190extern void restore_buffer (Lisp_Object); 1190extern void restore_buffer (Lisp_Object);
1191extern void set_buffer_if_live (Lisp_Object); 1191extern void set_buffer_if_live (Lisp_Object);
1192extern Lisp_Object build_overlay (bool, bool, Lisp_Object);
1192 1193
1193/* Return B as a struct buffer pointer, defaulting to the current buffer. */ 1194/* Return B as a struct buffer pointer, defaulting to the current buffer. */
1194 1195
@@ -1408,40 +1409,6 @@ overlay_end (struct Lisp_Overlay *ov)
1408 return interval_node_end (ov->buffer->overlays, ov->interval); 1409 return interval_node_end (ov->buffer->overlays, ov->interval);
1409} 1410}
1410 1411
1411INLINE void
1412set_overlay_region (struct Lisp_Overlay *ov, ptrdiff_t begin, ptrdiff_t end)
1413{
1414 eassert (ov->buffer);
1415 begin = clip_to_bounds (BEG, begin, ov->buffer->text->z);
1416 end = clip_to_bounds (begin, end, ov->buffer->text->z);
1417 interval_node_set_region (ov->buffer->overlays, ov->interval, begin, end);
1418}
1419
1420INLINE void
1421maybe_alloc_buffer_overlays (struct buffer *b)
1422{
1423 if (! b->overlays)
1424 b->overlays = interval_tree_create ();
1425}
1426
1427INLINE void
1428add_buffer_overlay (struct buffer *b, struct Lisp_Overlay *ov)
1429{
1430 eassert (! ov->buffer);
1431 maybe_alloc_buffer_overlays (b);
1432 ov->buffer = b;
1433 interval_tree_insert (b->overlays, ov->interval);
1434}
1435
1436INLINE void
1437remove_buffer_overlay (struct buffer *b, struct Lisp_Overlay *ov)
1438{
1439 eassert (b->overlays);
1440 eassert (ov->buffer == b);
1441 interval_tree_remove (ov->buffer->overlays, ov->interval);
1442 ov->buffer = NULL;
1443}
1444
1445/* Return the start of OV in its buffer, or -1 if OV is not associated 1412/* Return the start of OV in its buffer, or -1 if OV is not associated
1446 with any buffer. */ 1413 with any buffer. */
1447 1414