summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2012-08-08 16:12:40 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2012-08-08 16:12:40 +0400
commit8707c1e56ca83a0a34785e451dcef428c60242fe (patch)
treef404532e675b2870620faafa8d94dacf618c1a22 /src/buffer.h
parentad8c997f72c95b7351eab4c8ea2ac8c667545e6f (diff)
downloademacs-8707c1e56ca83a0a34785e451dcef428c60242fe.tar.gz
Inline functions to examine and change buffer intervals.
* alloc.c (mark_interval_tree): Remove. (MARK_INTERVAL_TREE): Simplify. (UNMARK_BALANCE_INTERVALS): Remove. Adjust users. * intervals.c (buffer_balance_intervals): New function. (graft_intervals_into_buffer): Adjust indentation. (set_intervals_multibyte): Simplify. * buffer.h (BUF_INTERVALS): Remove. (buffer_get_intervals, buffer_set_intervals): New function. * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c: * intervals.c, textprop.c: Adjust users.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 9618fc6ded1..986df8e6d32 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -193,9 +193,6 @@ INLINE_HEADER_BEGIN
/* FIXME: should we move this into ->text->auto_save_modiff? */
#define BUF_AUTOSAVE_MODIFF(buf) ((buf)->auto_save_modified)
-/* Interval tree of buffer. */
-#define BUF_INTERVALS(buf) ((buf)->text->intervals)
-
/* Marker chain of buffer. */
#define BUF_MARKERS(buf) ((buf)->text->markers)
@@ -951,7 +948,25 @@ extern void mmap_set_vars (int);
extern Lisp_Object Qbefore_change_functions;
extern Lisp_Object Qafter_change_functions;
extern Lisp_Object Qfirst_change_hook;
-
+
+/* Get text properties of B. */
+
+BUFFER_INLINE INTERVAL
+buffer_get_intervals (struct buffer *b)
+{
+ eassert (b->text != NULL);
+ return b->text->intervals;
+}
+
+/* Set text properties of B to I. */
+
+BUFFER_INLINE void
+buffer_set_intervals (struct buffer *b, INTERVAL i)
+{
+ eassert (b->text != NULL);
+ b->text->intervals = i;
+}
+
/* Return character code of multi-byte form at byte position POS. If POS
doesn't point the head of valid multi-byte form, only the byte at
POS is returned. No range checking.