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/buffer.h | |
| 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/buffer.h')
| -rw-r--r-- | src/buffer.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 | ||