diff options
| author | Dmitry Antipov | 2012-12-20 12:49:21 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-12-20 12:49:21 +0400 |
| commit | 1687fb14cd625aedce869411c841ff3fbf9ca43d (patch) | |
| tree | 87e830b3cd829676605146a6d2a3d1f23eefc924 /src | |
| parent | 87523aedc8a36a3be17e2918b0c8bd43cbe3618c (diff) | |
| download | emacs-1687fb14cd625aedce869411c841ff3fbf9ca43d.tar.gz emacs-1687fb14cd625aedce869411c841ff3fbf9ca43d.zip | |
* textprop.c (set_text_properties_1): Do not allow NULL interval.
Rename 4th argument since it may be buffer or string. Adjust comment.
* intervals.c (graft_intervals_info_buffer): Find an interval here.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/intervals.c | 3 | ||||
| -rw-r--r-- | src/textprop.c | 18 |
3 files changed, 16 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c324425a401..e31e35c7b49 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * textprop.c (set_text_properties_1): Do not allow NULL interval. | ||
| 4 | Rename 4th argument since it may be buffer or string. Adjust comment. | ||
| 5 | * intervals.c (graft_intervals_info_buffer): Find an interval here. | ||
| 6 | |||
| 1 | 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru> | 7 | 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 8 | ||
| 3 | * coding.c (Fdetect_coding_region): Do not check start and end with | 9 | * coding.c (Fdetect_coding_region): Do not check start and end with |
diff --git a/src/intervals.c b/src/intervals.c index 1ed93e1302d..807bbbfaa33 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -1624,7 +1624,8 @@ graft_intervals_into_buffer (INTERVAL source, ptrdiff_t position, | |||
| 1624 | XSETBUFFER (buf, buffer); | 1624 | XSETBUFFER (buf, buffer); |
| 1625 | set_text_properties_1 (make_number (position), | 1625 | set_text_properties_1 (make_number (position), |
| 1626 | make_number (position + length), | 1626 | make_number (position + length), |
| 1627 | Qnil, buf, 0); | 1627 | Qnil, buf, |
| 1628 | find_interval (tree, position)); | ||
| 1628 | } | 1629 | } |
| 1629 | /* Shouldn't be necessary. --Stef */ | 1630 | /* Shouldn't be necessary. --Stef */ |
| 1630 | buffer_balance_intervals (buffer); | 1631 | buffer_balance_intervals (buffer); |
diff --git a/src/textprop.c b/src/textprop.c index 1ce44ad60ac..13d772f15ba 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -1323,14 +1323,13 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, | |||
| 1323 | } | 1323 | } |
| 1324 | 1324 | ||
| 1325 | /* Replace properties of text from START to END with new list of | 1325 | /* Replace properties of text from START to END with new list of |
| 1326 | properties PROPERTIES. BUFFER is the buffer containing | 1326 | properties PROPERTIES. OBJECT is the buffer or string containing |
| 1327 | the text. This does not obey any hooks. | 1327 | the text. This does not obey any hooks. |
| 1328 | You can provide the interval that START is located in as I, | 1328 | You should provide the interval that START is located in as I. |
| 1329 | or pass NULL for I and this function will find it. | ||
| 1330 | START and END can be in any order. */ | 1329 | START and END can be in any order. */ |
| 1331 | 1330 | ||
| 1332 | void | 1331 | void |
| 1333 | set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i) | 1332 | set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object, INTERVAL i) |
| 1334 | { | 1333 | { |
| 1335 | register INTERVAL prev_changed = NULL; | 1334 | register INTERVAL prev_changed = NULL; |
| 1336 | register ptrdiff_t s, len; | 1335 | register ptrdiff_t s, len; |
| @@ -1349,8 +1348,7 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie | |||
| 1349 | else | 1348 | else |
| 1350 | return; | 1349 | return; |
| 1351 | 1350 | ||
| 1352 | if (i == NULL) | 1351 | eassert (i); |
| 1353 | i = find_interval (buffer_intervals (XBUFFER (buffer)), s); | ||
| 1354 | 1352 | ||
| 1355 | if (i->position != s) | 1353 | if (i->position != s) |
| 1356 | { | 1354 | { |
| @@ -1361,11 +1359,11 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie | |||
| 1361 | { | 1359 | { |
| 1362 | copy_properties (unchanged, i); | 1360 | copy_properties (unchanged, i); |
| 1363 | i = split_interval_left (i, len); | 1361 | i = split_interval_left (i, len); |
| 1364 | set_properties (properties, i, buffer); | 1362 | set_properties (properties, i, object); |
| 1365 | return; | 1363 | return; |
| 1366 | } | 1364 | } |
| 1367 | 1365 | ||
| 1368 | set_properties (properties, i, buffer); | 1366 | set_properties (properties, i, object); |
| 1369 | 1367 | ||
| 1370 | if (LENGTH (i) == len) | 1368 | if (LENGTH (i) == len) |
| 1371 | return; | 1369 | return; |
| @@ -1388,7 +1386,7 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie | |||
| 1388 | /* We have to call set_properties even if we are going to | 1386 | /* We have to call set_properties even if we are going to |
| 1389 | merge the intervals, so as to make the undo records | 1387 | merge the intervals, so as to make the undo records |
| 1390 | and cause redisplay to happen. */ | 1388 | and cause redisplay to happen. */ |
| 1391 | set_properties (properties, i, buffer); | 1389 | set_properties (properties, i, object); |
| 1392 | if (prev_changed) | 1390 | if (prev_changed) |
| 1393 | merge_interval_left (i); | 1391 | merge_interval_left (i); |
| 1394 | return; | 1392 | return; |
| @@ -1399,7 +1397,7 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie | |||
| 1399 | /* We have to call set_properties even if we are going to | 1397 | /* We have to call set_properties even if we are going to |
| 1400 | merge the intervals, so as to make the undo records | 1398 | merge the intervals, so as to make the undo records |
| 1401 | and cause redisplay to happen. */ | 1399 | and cause redisplay to happen. */ |
| 1402 | set_properties (properties, i, buffer); | 1400 | set_properties (properties, i, object); |
| 1403 | if (!prev_changed) | 1401 | if (!prev_changed) |
| 1404 | prev_changed = i; | 1402 | prev_changed = i; |
| 1405 | else | 1403 | else |