diff options
| author | Dmitry Antipov | 2012-08-08 16:12:40 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-08-08 16:12:40 +0400 |
| commit | 8707c1e56ca83a0a34785e451dcef428c60242fe (patch) | |
| tree | f404532e675b2870620faafa8d94dacf618c1a22 /src/buffer.h | |
| parent | ad8c997f72c95b7351eab4c8ea2ac8c667545e6f (diff) | |
| download | emacs-8707c1e56ca83a0a34785e451dcef428c60242fe.tar.gz emacs-8707c1e56ca83a0a34785e451dcef428c60242fe.zip | |
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.h | 23 |
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 | |||
| 193 | /* FIXME: should we move this into ->text->auto_save_modiff? */ | 193 | /* FIXME: should we move this into ->text->auto_save_modiff? */ |
| 194 | #define BUF_AUTOSAVE_MODIFF(buf) ((buf)->auto_save_modified) | 194 | #define BUF_AUTOSAVE_MODIFF(buf) ((buf)->auto_save_modified) |
| 195 | 195 | ||
| 196 | /* Interval tree of buffer. */ | ||
| 197 | #define BUF_INTERVALS(buf) ((buf)->text->intervals) | ||
| 198 | |||
| 199 | /* Marker chain of buffer. */ | 196 | /* Marker chain of buffer. */ |
| 200 | #define BUF_MARKERS(buf) ((buf)->text->markers) | 197 | #define BUF_MARKERS(buf) ((buf)->text->markers) |
| 201 | 198 | ||
| @@ -951,7 +948,25 @@ extern void mmap_set_vars (int); | |||
| 951 | extern Lisp_Object Qbefore_change_functions; | 948 | extern Lisp_Object Qbefore_change_functions; |
| 952 | extern Lisp_Object Qafter_change_functions; | 949 | extern Lisp_Object Qafter_change_functions; |
| 953 | extern Lisp_Object Qfirst_change_hook; | 950 | extern Lisp_Object Qfirst_change_hook; |
| 954 | 951 | ||
| 952 | /* Get text properties of B. */ | ||
| 953 | |||
| 954 | BUFFER_INLINE INTERVAL | ||
| 955 | buffer_get_intervals (struct buffer *b) | ||
| 956 | { | ||
| 957 | eassert (b->text != NULL); | ||
| 958 | return b->text->intervals; | ||
| 959 | } | ||
| 960 | |||
| 961 | /* Set text properties of B to I. */ | ||
| 962 | |||
| 963 | BUFFER_INLINE void | ||
| 964 | buffer_set_intervals (struct buffer *b, INTERVAL i) | ||
| 965 | { | ||
| 966 | eassert (b->text != NULL); | ||
| 967 | b->text->intervals = i; | ||
| 968 | } | ||
| 969 | |||
| 955 | /* Return character code of multi-byte form at byte position POS. If POS | 970 | /* Return character code of multi-byte form at byte position POS. If POS |
| 956 | doesn't point the head of valid multi-byte form, only the byte at | 971 | doesn't point the head of valid multi-byte form, only the byte at |
| 957 | POS is returned. No range checking. | 972 | POS is returned. No range checking. |