diff options
| author | Joakim Verona | 2011-11-07 10:03:00 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-11-07 10:03:00 +0100 |
| commit | c649990b73768c7a024e111d8c63246030647b53 (patch) | |
| tree | e5b47169dfc679b53fed30bbd66e2df98de2f02c /src/intervals.c | |
| parent | c823c667cd00b9d8036ce06b943f58f3f4efd7d9 (diff) | |
| parent | ca78dc431fff3bc2a4f33f2a0fc1449608568d23 (diff) | |
| download | emacs-c649990b73768c7a024e111d8c63246030647b53.tar.gz emacs-c649990b73768c7a024e111d8c63246030647b53.zip | |
upstream
Diffstat (limited to 'src/intervals.c')
| -rw-r--r-- | src/intervals.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/intervals.c b/src/intervals.c index 1f3f8cf793e..be1bdfb9056 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -52,6 +52,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 52 | 52 | ||
| 53 | #define TMEM(sym, set) (CONSP (set) ? ! NILP (Fmemq (sym, set)) : ! NILP (set)) | 53 | #define TMEM(sym, set) (CONSP (set) ? ! NILP (Fmemq (sym, set)) : ! NILP (set)) |
| 54 | 54 | ||
| 55 | extern INTERVAL adjust_intervals_for_insertion (INTERVAL, | ||
| 56 | EMACS_INT, EMACS_INT); | ||
| 57 | extern void adjust_intervals_for_deletion (struct buffer *, | ||
| 58 | EMACS_INT, EMACS_INT); | ||
| 59 | |||
| 55 | static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); | 60 | static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); |
| 56 | static INTERVAL merge_interval_right (INTERVAL); | 61 | static INTERVAL merge_interval_right (INTERVAL); |
| 57 | static INTERVAL reproduce_tree (INTERVAL, INTERVAL); | 62 | static INTERVAL reproduce_tree (INTERVAL, INTERVAL); |
| @@ -798,7 +803,7 @@ update_interval (register INTERVAL i, EMACS_INT pos) | |||
| 798 | and check the hungry bits of both. Then add the length going back up | 803 | and check the hungry bits of both. Then add the length going back up |
| 799 | to the root. */ | 804 | to the root. */ |
| 800 | 805 | ||
| 801 | static INTERVAL | 806 | INTERVAL |
| 802 | adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, | 807 | adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, |
| 803 | EMACS_INT length) | 808 | EMACS_INT length) |
| 804 | { | 809 | { |
| @@ -859,7 +864,7 @@ adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, | |||
| 859 | interval. Another possibility would be to create a new interval for | 864 | interval. Another possibility would be to create a new interval for |
| 860 | this text, and make it have the merged properties of both ends. */ | 865 | this text, and make it have the merged properties of both ends. */ |
| 861 | 866 | ||
| 862 | static INTERVAL | 867 | INTERVAL |
| 863 | adjust_intervals_for_insertion (INTERVAL tree, | 868 | adjust_intervals_for_insertion (INTERVAL tree, |
| 864 | EMACS_INT position, EMACS_INT length) | 869 | EMACS_INT position, EMACS_INT length) |
| 865 | { | 870 | { |
| @@ -1369,7 +1374,7 @@ interval_deletion_adjustment (register INTERVAL tree, register EMACS_INT from, | |||
| 1369 | text. The deletion is effected at position START (which is a | 1374 | text. The deletion is effected at position START (which is a |
| 1370 | buffer position, i.e. origin 1). */ | 1375 | buffer position, i.e. origin 1). */ |
| 1371 | 1376 | ||
| 1372 | static void | 1377 | void |
| 1373 | adjust_intervals_for_deletion (struct buffer *buffer, | 1378 | adjust_intervals_for_deletion (struct buffer *buffer, |
| 1374 | EMACS_INT start, EMACS_INT length) | 1379 | EMACS_INT start, EMACS_INT length) |
| 1375 | { | 1380 | { |
| @@ -1425,9 +1430,8 @@ adjust_intervals_for_deletion (struct buffer *buffer, | |||
| 1425 | compiler that does not allow calling a static function (here, | 1430 | compiler that does not allow calling a static function (here, |
| 1426 | adjust_intervals_for_deletion) from a non-static inline function. */ | 1431 | adjust_intervals_for_deletion) from a non-static inline function. */ |
| 1427 | 1432 | ||
| 1428 | static inline void | 1433 | inline void |
| 1429 | static_offset_intervals (struct buffer *buffer, EMACS_INT start, | 1434 | offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) |
| 1430 | EMACS_INT length) | ||
| 1431 | { | 1435 | { |
| 1432 | if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) | 1436 | if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) |
| 1433 | return; | 1437 | return; |
| @@ -1440,12 +1444,6 @@ static_offset_intervals (struct buffer *buffer, EMACS_INT start, | |||
| 1440 | adjust_intervals_for_deletion (buffer, start, -length); | 1444 | adjust_intervals_for_deletion (buffer, start, -length); |
| 1441 | } | 1445 | } |
| 1442 | } | 1446 | } |
| 1443 | |||
| 1444 | inline void | ||
| 1445 | offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) | ||
| 1446 | { | ||
| 1447 | static_offset_intervals (buffer, start, length); | ||
| 1448 | } | ||
| 1449 | 1447 | ||
| 1450 | /* Merge interval I with its lexicographic successor. The resulting | 1448 | /* Merge interval I with its lexicographic successor. The resulting |
| 1451 | interval is returned, and has the properties of the original | 1449 | interval is returned, and has the properties of the original |