diff options
| author | Chong Yidong | 2006-09-01 13:28:13 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-09-01 13:28:13 +0000 |
| commit | 3e1451520bdae2a79247347e66724306692533f6 (patch) | |
| tree | e652c2d5f077b41d82c14d815d75531a96a546d5 /src | |
| parent | d178a6ebf9c714f2360997d16746d8c81f04f07b (diff) | |
| download | emacs-3e1451520bdae2a79247347e66724306692533f6.tar.gz emacs-3e1451520bdae2a79247347e66724306692533f6.zip | |
* buffer.h (struct buffer_text): New field chars_modiff.
(CHARS_MODIFF, BUF_CHARS_MODIFF): New macros.
* buffer.c (Fbuffer_chars_modified_tick): New function returning
value of BUF_CHARS_MODIFF.
(syms_of_buffer): Defsubr it.
(Fget_buffer_create): Initialize BUF_CHARS_MODIFF.
* insdel.c (modify_region): New argument preserve_chars_modiff.
Set CHARS_MODIFF to MODIFF provided preserve_chars_modiff is zero.
(insert_1_both, insert_from_string_1, insert_from_buffer_1)
(adjust_after_replace, adjust_after_replace_noundo)
(replace_range, replace_range_2, del_range_2): Reset CHARS_MODIFF.
* lisp.h (modify_region): Add fourth argument in extern.
* casefiddle.c (casify_region): Call modify_region with fourth
argument zero to assert that CHARS_MODIFF is updated.
* editfns.c (Fsubst_char_in_region, Ftranslate_region_internal)
(Ftranspose_regions): Likewise.
* textprop.c (Fadd_text_properties, Fset_text_properties)
(Fremove_text_properties, Fremove_list_of_text_properties):
Call modify_region with fourth argument 1 to avoid that
CHARS_MODIFF is updated.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 23 | ||||
| -rw-r--r-- | src/buffer.c | 27 | ||||
| -rw-r--r-- | src/buffer.h | 10 | ||||
| -rw-r--r-- | src/casefiddle.c | 2 | ||||
| -rw-r--r-- | src/editfns.c | 14 | ||||
| -rw-r--r-- | src/insdel.c | 19 | ||||
| -rw-r--r-- | src/lisp.h | 2 | ||||
| -rw-r--r-- | src/textprop.c | 12 |
8 files changed, 91 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f0f8ebf9d79..f2395388d0f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,26 @@ | |||
| 1 | 2006-08-03 Martin Rudalics <address@hidden> | ||
| 2 | |||
| 3 | * buffer.h (struct buffer_text): New field chars_modiff. | ||
| 4 | (CHARS_MODIFF, BUF_CHARS_MODIFF): New macros. | ||
| 5 | * buffer.c (Fbuffer_chars_modified_tick): New function returning | ||
| 6 | value of BUF_CHARS_MODIFF. | ||
| 7 | (syms_of_buffer): Defsubr it. | ||
| 8 | (Fget_buffer_create): Initialize BUF_CHARS_MODIFF. | ||
| 9 | * insdel.c (modify_region): New argument preserve_chars_modiff. | ||
| 10 | Set CHARS_MODIFF to MODIFF provided preserve_chars_modiff is zero. | ||
| 11 | (insert_1_both, insert_from_string_1, insert_from_buffer_1) | ||
| 12 | (adjust_after_replace, adjust_after_replace_noundo) | ||
| 13 | (replace_range, replace_range_2, del_range_2): Reset CHARS_MODIFF. | ||
| 14 | * lisp.h (modify_region): Add fourth argument in extern. | ||
| 15 | * casefiddle.c (casify_region): Call modify_region with fourth | ||
| 16 | argument zero to assert that CHARS_MODIFF is updated. | ||
| 17 | * editfns.c (Fsubst_char_in_region, Ftranslate_region_internal) | ||
| 18 | (Ftranspose_regions): Likewise. | ||
| 19 | * textprop.c (Fadd_text_properties, Fset_text_properties) | ||
| 20 | (Fremove_text_properties, Fremove_list_of_text_properties): | ||
| 21 | Call modify_region with fourth argument 1 to avoid that | ||
| 22 | CHARS_MODIFF is updated. | ||
| 23 | |||
| 1 | 2006-08-31 Richard Stallman <rms@gnu.org> | 24 | 2006-08-31 Richard Stallman <rms@gnu.org> |
| 2 | 25 | ||
| 3 | * editfns.c (Fformat): Don't sign-extend for %o or %x. | 26 | * editfns.c (Fformat): Don't sign-extend for %o or %x. |
diff --git a/src/buffer.c b/src/buffer.c index 863b217d2b4..58c047a87ba 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -374,6 +374,7 @@ The value is never nil. */) | |||
| 374 | BUF_ZV_BYTE (b) = BEG_BYTE; | 374 | BUF_ZV_BYTE (b) = BEG_BYTE; |
| 375 | BUF_Z_BYTE (b) = BEG_BYTE; | 375 | BUF_Z_BYTE (b) = BEG_BYTE; |
| 376 | BUF_MODIFF (b) = 1; | 376 | BUF_MODIFF (b) = 1; |
| 377 | BUF_CHARS_MODIFF (b) = 1; | ||
| 377 | BUF_OVERLAY_MODIFF (b) = 1; | 378 | BUF_OVERLAY_MODIFF (b) = 1; |
| 378 | BUF_SAVE_MODIFF (b) = 1; | 379 | BUF_SAVE_MODIFF (b) = 1; |
| 379 | BUF_INTERVALS (b) = 0; | 380 | BUF_INTERVALS (b) = 0; |
| @@ -1148,6 +1149,31 @@ No argument or nil as argument means use current buffer as BUFFER. */) | |||
| 1148 | 1149 | ||
| 1149 | return make_number (BUF_MODIFF (buf)); | 1150 | return make_number (BUF_MODIFF (buf)); |
| 1150 | } | 1151 | } |
| 1152 | |||
| 1153 | DEFUN ("buffer-chars-modified-tick", Fbuffer_chars_modified_tick, | ||
| 1154 | Sbuffer_chars_modified_tick, 0, 1, 0, | ||
| 1155 | doc: /* Return BUFFER's character-change tick counter. | ||
| 1156 | Each buffer has a character-change tick counter, which is set to the | ||
| 1157 | value of the buffer's tick counter \(see `buffer-modified-tick'), each | ||
| 1158 | time text in that buffer is inserted or deleted. By comparing the | ||
| 1159 | values returned by two individual calls of buffer-chars-modified-tick, | ||
| 1160 | you can tell whether a character change occurred in that buffer in | ||
| 1161 | between these calls. No argument or nil as argument means use current | ||
| 1162 | buffer as BUFFER. */) | ||
| 1163 | (buffer) | ||
| 1164 | register Lisp_Object buffer; | ||
| 1165 | { | ||
| 1166 | register struct buffer *buf; | ||
| 1167 | if (NILP (buffer)) | ||
| 1168 | buf = current_buffer; | ||
| 1169 | else | ||
| 1170 | { | ||
| 1171 | CHECK_BUFFER (buffer); | ||
| 1172 | buf = XBUFFER (buffer); | ||
| 1173 | } | ||
| 1174 | |||
| 1175 | return make_number (BUF_CHARS_MODIFF (buf)); | ||
| 1176 | } | ||
| 1151 | 1177 | ||
| 1152 | DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2, | 1178 | DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2, |
| 1153 | "sRename buffer (to new name): \nP", | 1179 | "sRename buffer (to new name): \nP", |
| @@ -6044,6 +6070,7 @@ The function `kill-all-local-variables' runs this before doing anything else. * | |||
| 6044 | defsubr (&Sbuffer_modified_p); | 6070 | defsubr (&Sbuffer_modified_p); |
| 6045 | defsubr (&Sset_buffer_modified_p); | 6071 | defsubr (&Sset_buffer_modified_p); |
| 6046 | defsubr (&Sbuffer_modified_tick); | 6072 | defsubr (&Sbuffer_modified_tick); |
| 6073 | defsubr (&Sbuffer_chars_modified_tick); | ||
| 6047 | defsubr (&Srename_buffer); | 6074 | defsubr (&Srename_buffer); |
| 6048 | defsubr (&Sother_buffer); | 6075 | defsubr (&Sother_buffer); |
| 6049 | defsubr (&Sbuffer_enable_undo); | 6076 | defsubr (&Sbuffer_enable_undo); |
diff --git a/src/buffer.h b/src/buffer.h index efe0252453a..a5f8a6a4070 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -82,6 +82,9 @@ Boston, MA 02110-1301, USA. */ | |||
| 82 | /* Modification count. */ | 82 | /* Modification count. */ |
| 83 | #define MODIFF (current_buffer->text->modiff) | 83 | #define MODIFF (current_buffer->text->modiff) |
| 84 | 84 | ||
| 85 | /* Character modification count. */ | ||
| 86 | #define CHARS_MODIFF (current_buffer->text->chars_modiff) | ||
| 87 | |||
| 85 | /* Overlay modification count. */ | 88 | /* Overlay modification count. */ |
| 86 | #define OVERLAY_MODIFF (current_buffer->text->overlay_modiff) | 89 | #define OVERLAY_MODIFF (current_buffer->text->overlay_modiff) |
| 87 | 90 | ||
| @@ -147,6 +150,9 @@ Boston, MA 02110-1301, USA. */ | |||
| 147 | /* Modification count. */ | 150 | /* Modification count. */ |
| 148 | #define BUF_MODIFF(buf) ((buf)->text->modiff) | 151 | #define BUF_MODIFF(buf) ((buf)->text->modiff) |
| 149 | 152 | ||
| 153 | /* Character modification count. */ | ||
| 154 | #define BUF_CHARS_MODIFF(buf) ((buf)->text->chars_modiff) | ||
| 155 | |||
| 150 | /* Modification count as of last visit or save. */ | 156 | /* Modification count as of last visit or save. */ |
| 151 | #define BUF_SAVE_MODIFF(buf) ((buf)->text->save_modiff) | 157 | #define BUF_SAVE_MODIFF(buf) ((buf)->text->save_modiff) |
| 152 | 158 | ||
| @@ -406,6 +412,10 @@ struct buffer_text | |||
| 406 | for this buffer. It is incremented for | 412 | for this buffer. It is incremented for |
| 407 | each such event, and never otherwise | 413 | each such event, and never otherwise |
| 408 | changed. */ | 414 | changed. */ |
| 415 | int chars_modiff; /* This is modified with character change | ||
| 416 | events for this buffer. It is set to | ||
| 417 | modiff for each such event, and never | ||
| 418 | otherwise changed. */ | ||
| 409 | int save_modiff; /* Previous value of modiff, as of last | 419 | int save_modiff; /* Previous value of modiff, as of last |
| 410 | time buffer visited or saved a file. */ | 420 | time buffer visited or saved a file. */ |
| 411 | 421 | ||
diff --git a/src/casefiddle.c b/src/casefiddle.c index 0ad884310ed..cb7c953a3e4 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c | |||
| @@ -187,7 +187,7 @@ casify_region (flag, b, e) | |||
| 187 | validate_region (&b, &e); | 187 | validate_region (&b, &e); |
| 188 | start = XFASTINT (b); | 188 | start = XFASTINT (b); |
| 189 | end = XFASTINT (e); | 189 | end = XFASTINT (e); |
| 190 | modify_region (current_buffer, start, end); | 190 | modify_region (current_buffer, start, end, 0); |
| 191 | record_change (start, end - start); | 191 | record_change (start, end - start); |
| 192 | start_byte = CHAR_TO_BYTE (start); | 192 | start_byte = CHAR_TO_BYTE (start); |
| 193 | end_byte = CHAR_TO_BYTE (end); | 193 | end_byte = CHAR_TO_BYTE (end); |
diff --git a/src/editfns.c b/src/editfns.c index e916b505fe8..2c392df564e 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -2781,7 +2781,7 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2781 | else if (!changed) | 2781 | else if (!changed) |
| 2782 | { | 2782 | { |
| 2783 | changed = -1; | 2783 | changed = -1; |
| 2784 | modify_region (current_buffer, pos, XINT (end)); | 2784 | modify_region (current_buffer, pos, XINT (end), 0); |
| 2785 | 2785 | ||
| 2786 | if (! NILP (noundo)) | 2786 | if (! NILP (noundo)) |
| 2787 | { | 2787 | { |
| @@ -2897,7 +2897,7 @@ It returns the number of characters changed. */) | |||
| 2897 | pos = XINT (start); | 2897 | pos = XINT (start); |
| 2898 | pos_byte = CHAR_TO_BYTE (pos); | 2898 | pos_byte = CHAR_TO_BYTE (pos); |
| 2899 | end_pos = XINT (end); | 2899 | end_pos = XINT (end); |
| 2900 | modify_region (current_buffer, pos, XINT (end)); | 2900 | modify_region (current_buffer, pos, XINT (end), 0); |
| 2901 | 2901 | ||
| 2902 | cnt = 0; | 2902 | cnt = 0; |
| 2903 | for (; pos < end_pos; ) | 2903 | for (; pos < end_pos; ) |
| @@ -4168,7 +4168,7 @@ Transposing beyond buffer boundaries is an error. */) | |||
| 4168 | 4168 | ||
| 4169 | if (end1 == start2) /* adjacent regions */ | 4169 | if (end1 == start2) /* adjacent regions */ |
| 4170 | { | 4170 | { |
| 4171 | modify_region (current_buffer, start1, end2); | 4171 | modify_region (current_buffer, start1, end2, 0); |
| 4172 | record_change (start1, len1 + len2); | 4172 | record_change (start1, len1 + len2); |
| 4173 | 4173 | ||
| 4174 | tmp_interval1 = copy_intervals (cur_intv, start1, len1); | 4174 | tmp_interval1 = copy_intervals (cur_intv, start1, len1); |
| @@ -4224,8 +4224,8 @@ Transposing beyond buffer boundaries is an error. */) | |||
| 4224 | { | 4224 | { |
| 4225 | USE_SAFE_ALLOCA; | 4225 | USE_SAFE_ALLOCA; |
| 4226 | 4226 | ||
| 4227 | modify_region (current_buffer, start1, end1); | 4227 | modify_region (current_buffer, start1, end1, 0); |
| 4228 | modify_region (current_buffer, start2, end2); | 4228 | modify_region (current_buffer, start2, end2, 0); |
| 4229 | record_change (start1, len1); | 4229 | record_change (start1, len1); |
| 4230 | record_change (start2, len2); | 4230 | record_change (start2, len2); |
| 4231 | tmp_interval1 = copy_intervals (cur_intv, start1, len1); | 4231 | tmp_interval1 = copy_intervals (cur_intv, start1, len1); |
| @@ -4254,7 +4254,7 @@ Transposing beyond buffer boundaries is an error. */) | |||
| 4254 | { | 4254 | { |
| 4255 | USE_SAFE_ALLOCA; | 4255 | USE_SAFE_ALLOCA; |
| 4256 | 4256 | ||
| 4257 | modify_region (current_buffer, start1, end2); | 4257 | modify_region (current_buffer, start1, end2, 0); |
| 4258 | record_change (start1, (end2 - start1)); | 4258 | record_change (start1, (end2 - start1)); |
| 4259 | tmp_interval1 = copy_intervals (cur_intv, start1, len1); | 4259 | tmp_interval1 = copy_intervals (cur_intv, start1, len1); |
| 4260 | tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid); | 4260 | tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid); |
| @@ -4285,7 +4285,7 @@ Transposing beyond buffer boundaries is an error. */) | |||
| 4285 | USE_SAFE_ALLOCA; | 4285 | USE_SAFE_ALLOCA; |
| 4286 | 4286 | ||
| 4287 | record_change (start1, (end2 - start1)); | 4287 | record_change (start1, (end2 - start1)); |
| 4288 | modify_region (current_buffer, start1, end2); | 4288 | modify_region (current_buffer, start1, end2, 0); |
| 4289 | 4289 | ||
| 4290 | tmp_interval1 = copy_intervals (cur_intv, start1, len1); | 4290 | tmp_interval1 = copy_intervals (cur_intv, start1, len1); |
| 4291 | tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid); | 4291 | tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid); |
diff --git a/src/insdel.c b/src/insdel.c index b97539c1cc2..bd6e30d9449 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -1007,6 +1007,7 @@ insert_1_both (string, nchars, nbytes, inherit, prepare, before_markers) | |||
| 1007 | will add up to the right stuff in the undo list. */ | 1007 | will add up to the right stuff in the undo list. */ |
| 1008 | record_insert (PT, nchars); | 1008 | record_insert (PT, nchars); |
| 1009 | MODIFF++; | 1009 | MODIFF++; |
| 1010 | CHARS_MODIFF = MODIFF; | ||
| 1010 | 1011 | ||
| 1011 | bcopy (string, GPT_ADDR, nbytes); | 1012 | bcopy (string, GPT_ADDR, nbytes); |
| 1012 | 1013 | ||
| @@ -1144,6 +1145,7 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes, | |||
| 1144 | 1145 | ||
| 1145 | record_insert (PT, nchars); | 1146 | record_insert (PT, nchars); |
| 1146 | MODIFF++; | 1147 | MODIFF++; |
| 1148 | CHARS_MODIFF = MODIFF; | ||
| 1147 | 1149 | ||
| 1148 | GAP_SIZE -= outgoing_nbytes; | 1150 | GAP_SIZE -= outgoing_nbytes; |
| 1149 | GPT += nchars; | 1151 | GPT += nchars; |
| @@ -1295,6 +1297,7 @@ insert_from_buffer_1 (buf, from, nchars, inherit) | |||
| 1295 | 1297 | ||
| 1296 | record_insert (PT, nchars); | 1298 | record_insert (PT, nchars); |
| 1297 | MODIFF++; | 1299 | MODIFF++; |
| 1300 | CHARS_MODIFF = MODIFF; | ||
| 1298 | 1301 | ||
| 1299 | GAP_SIZE -= outgoing_nbytes; | 1302 | GAP_SIZE -= outgoing_nbytes; |
| 1300 | GPT += nchars; | 1303 | GPT += nchars; |
| @@ -1403,6 +1406,7 @@ adjust_after_replace (from, from_byte, prev_text, len, len_byte) | |||
| 1403 | if (len == 0) | 1406 | if (len == 0) |
| 1404 | evaporate_overlays (from); | 1407 | evaporate_overlays (from); |
| 1405 | MODIFF++; | 1408 | MODIFF++; |
| 1409 | CHARS_MODIFF = MODIFF; | ||
| 1406 | } | 1410 | } |
| 1407 | 1411 | ||
| 1408 | /* Like adjust_after_replace, but doesn't require PREV_TEXT. | 1412 | /* Like adjust_after_replace, but doesn't require PREV_TEXT. |
| @@ -1453,6 +1457,7 @@ adjust_after_replace_noundo (from, from_byte, nchars_del, nbytes_del, len, len_b | |||
| 1453 | if (len == 0) | 1457 | if (len == 0) |
| 1454 | evaporate_overlays (from); | 1458 | evaporate_overlays (from); |
| 1455 | MODIFF++; | 1459 | MODIFF++; |
| 1460 | CHARS_MODIFF = MODIFF; | ||
| 1456 | } | 1461 | } |
| 1457 | 1462 | ||
| 1458 | /* Record undo information, adjust markers and position keepers for an | 1463 | /* Record undo information, adjust markers and position keepers for an |
| @@ -1645,6 +1650,7 @@ replace_range (from, to, new, prepare, inherit, markers) | |||
| 1645 | CHECK_MARKERS (); | 1650 | CHECK_MARKERS (); |
| 1646 | 1651 | ||
| 1647 | MODIFF++; | 1652 | MODIFF++; |
| 1653 | CHARS_MODIFF = MODIFF; | ||
| 1648 | UNGCPRO; | 1654 | UNGCPRO; |
| 1649 | 1655 | ||
| 1650 | signal_after_change (from, nchars_del, GPT - from); | 1656 | signal_after_change (from, nchars_del, GPT - from); |
| @@ -1769,6 +1775,7 @@ replace_range_2 (from, from_byte, to, to_byte, ins, inschars, insbytes, markers) | |||
| 1769 | CHECK_MARKERS (); | 1775 | CHECK_MARKERS (); |
| 1770 | 1776 | ||
| 1771 | MODIFF++; | 1777 | MODIFF++; |
| 1778 | CHARS_MODIFF = MODIFF; | ||
| 1772 | } | 1779 | } |
| 1773 | 1780 | ||
| 1774 | /* Delete characters in current buffer | 1781 | /* Delete characters in current buffer |
| @@ -1950,6 +1957,7 @@ del_range_2 (from, from_byte, to, to_byte, ret_string) | |||
| 1950 | if (! EQ (current_buffer->undo_list, Qt)) | 1957 | if (! EQ (current_buffer->undo_list, Qt)) |
| 1951 | record_delete (from, deletion); | 1958 | record_delete (from, deletion); |
| 1952 | MODIFF++; | 1959 | MODIFF++; |
| 1960 | CHARS_MODIFF = MODIFF; | ||
| 1953 | 1961 | ||
| 1954 | /* Relocate point as if it were a marker. */ | 1962 | /* Relocate point as if it were a marker. */ |
| 1955 | if (from < PT) | 1963 | if (from < PT) |
| @@ -1990,12 +1998,15 @@ del_range_2 (from, from_byte, to, to_byte, ret_string) | |||
| 1990 | character positions START to END. This checks the read-only | 1998 | character positions START to END. This checks the read-only |
| 1991 | properties of the region, calls the necessary modification hooks, | 1999 | properties of the region, calls the necessary modification hooks, |
| 1992 | and warns the next redisplay that it should pay attention to that | 2000 | and warns the next redisplay that it should pay attention to that |
| 1993 | area. */ | 2001 | area. |
| 2002 | |||
| 2003 | If PRESERVE_CHARS_MODIFF is non-zero, do not update CHARS_MODIFF. | ||
| 2004 | Otherwise set CHARS_MODIFF to the new value of MODIFF. */ | ||
| 1994 | 2005 | ||
| 1995 | void | 2006 | void |
| 1996 | modify_region (buffer, start, end) | 2007 | modify_region (buffer, start, end, preserve_chars_modiff) |
| 1997 | struct buffer *buffer; | 2008 | struct buffer *buffer; |
| 1998 | int start, end; | 2009 | int start, end, preserve_chars_modiff; |
| 1999 | { | 2010 | { |
| 2000 | struct buffer *old_buffer = current_buffer; | 2011 | struct buffer *old_buffer = current_buffer; |
| 2001 | 2012 | ||
| @@ -2009,6 +2020,8 @@ modify_region (buffer, start, end) | |||
| 2009 | if (MODIFF <= SAVE_MODIFF) | 2020 | if (MODIFF <= SAVE_MODIFF) |
| 2010 | record_first_change (); | 2021 | record_first_change (); |
| 2011 | MODIFF++; | 2022 | MODIFF++; |
| 2023 | if (! preserve_chars_modiff) | ||
| 2024 | CHARS_MODIFF = MODIFF; | ||
| 2012 | 2025 | ||
| 2013 | buffer->point_before_scroll = Qnil; | 2026 | buffer->point_before_scroll = Qnil; |
| 2014 | 2027 | ||
diff --git a/src/lisp.h b/src/lisp.h index 0fb14136a53..3d7870c4867 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2471,7 +2471,7 @@ extern Lisp_Object del_range_1 P_ ((int, int, int, int)); | |||
| 2471 | extern void del_range_byte P_ ((int, int, int)); | 2471 | extern void del_range_byte P_ ((int, int, int)); |
| 2472 | extern void del_range_both P_ ((int, int, int, int, int)); | 2472 | extern void del_range_both P_ ((int, int, int, int, int)); |
| 2473 | extern Lisp_Object del_range_2 P_ ((int, int, int, int, int)); | 2473 | extern Lisp_Object del_range_2 P_ ((int, int, int, int, int)); |
| 2474 | extern void modify_region P_ ((struct buffer *, int, int)); | 2474 | extern void modify_region P_ ((struct buffer *, int, int, int)); |
| 2475 | extern void prepare_to_modify_buffer P_ ((int, int, int *)); | 2475 | extern void prepare_to_modify_buffer P_ ((int, int, int *)); |
| 2476 | extern void signal_before_change P_ ((int, int, int *)); | 2476 | extern void signal_before_change P_ ((int, int, int *)); |
| 2477 | extern void signal_after_change P_ ((int, int, int)); | 2477 | extern void signal_after_change P_ ((int, int, int)); |
diff --git a/src/textprop.c b/src/textprop.c index fd70f039d22..785ed19b566 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -1253,7 +1253,7 @@ Return t if any property value actually changed, nil otherwise. */) | |||
| 1253 | } | 1253 | } |
| 1254 | 1254 | ||
| 1255 | if (BUFFERP (object)) | 1255 | if (BUFFERP (object)) |
| 1256 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | 1256 | modify_region (XBUFFER (object), XINT (start), XINT (end), 1); |
| 1257 | 1257 | ||
| 1258 | /* We are at the beginning of interval I, with LEN chars to scan. */ | 1258 | /* We are at the beginning of interval I, with LEN chars to scan. */ |
| 1259 | for (;;) | 1259 | for (;;) |
| @@ -1393,7 +1393,7 @@ set_text_properties (start, end, properties, object, signal_after_change_p) | |||
| 1393 | } | 1393 | } |
| 1394 | 1394 | ||
| 1395 | if (BUFFERP (object)) | 1395 | if (BUFFERP (object)) |
| 1396 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | 1396 | modify_region (XBUFFER (object), XINT (start), XINT (end), 1); |
| 1397 | 1397 | ||
| 1398 | set_text_properties_1 (start, end, properties, object, i); | 1398 | set_text_properties_1 (start, end, properties, object, i); |
| 1399 | 1399 | ||
| @@ -1541,7 +1541,7 @@ Use set-text-properties if you want to remove all text properties. */) | |||
| 1541 | } | 1541 | } |
| 1542 | 1542 | ||
| 1543 | if (BUFFERP (object)) | 1543 | if (BUFFERP (object)) |
| 1544 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | 1544 | modify_region (XBUFFER (object), XINT (start), XINT (end), 1); |
| 1545 | 1545 | ||
| 1546 | /* We are at the beginning of an interval, with len to scan */ | 1546 | /* We are at the beginning of an interval, with len to scan */ |
| 1547 | for (;;) | 1547 | for (;;) |
| @@ -1655,7 +1655,7 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1655 | if (LENGTH (i) == len) | 1655 | if (LENGTH (i) == len) |
| 1656 | { | 1656 | { |
| 1657 | if (!modified && BUFFERP (object)) | 1657 | if (!modified && BUFFERP (object)) |
| 1658 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | 1658 | modify_region (XBUFFER (object), XINT (start), XINT (end), 1); |
| 1659 | remove_properties (Qnil, properties, i, object); | 1659 | remove_properties (Qnil, properties, i, object); |
| 1660 | if (BUFFERP (object)) | 1660 | if (BUFFERP (object)) |
| 1661 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1661 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| @@ -1668,7 +1668,7 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1668 | i = split_interval_left (i, len); | 1668 | i = split_interval_left (i, len); |
| 1669 | copy_properties (unchanged, i); | 1669 | copy_properties (unchanged, i); |
| 1670 | if (!modified && BUFFERP (object)) | 1670 | if (!modified && BUFFERP (object)) |
| 1671 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | 1671 | modify_region (XBUFFER (object), XINT (start), XINT (end), 1); |
| 1672 | remove_properties (Qnil, properties, i, object); | 1672 | remove_properties (Qnil, properties, i, object); |
| 1673 | if (BUFFERP (object)) | 1673 | if (BUFFERP (object)) |
| 1674 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1674 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| @@ -1679,7 +1679,7 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1679 | if (interval_has_some_properties_list (properties, i)) | 1679 | if (interval_has_some_properties_list (properties, i)) |
| 1680 | { | 1680 | { |
| 1681 | if (!modified && BUFFERP (object)) | 1681 | if (!modified && BUFFERP (object)) |
| 1682 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | 1682 | modify_region (XBUFFER (object), XINT (start), XINT (end), 1); |
| 1683 | remove_properties (Qnil, properties, i, object); | 1683 | remove_properties (Qnil, properties, i, object); |
| 1684 | modified = 1; | 1684 | modified = 1; |
| 1685 | } | 1685 | } |