diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2012-12-03 18:13:06 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2012-12-03 18:13:06 +0400 |
commit | 20edc1c9edbb8c896df0a54769a4da825017de22 (patch) | |
tree | 5c431923887d8e48a1e932c4540f9aa48c611504 /src/insdel.c | |
parent | 62c2e5ed3a9c991cef2594b44afc74893f6ce26b (diff) |
* lisp.h (modify_region): Rename to...
(modify_region_1): ...new prototype.
* textprop.c (modify_region): Now static. Adjust users.
* insdel.c (modify_region): Rename to...
(modify_region_1): ...new function to work with current buffer.
Adjust comment and users. Use true and false for boolean arg.
Diffstat (limited to 'src/insdel.c')
-rw-r--r-- | src/insdel.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/insdel.c b/src/insdel.c index 87010cd825..892ca3d521 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1755,9 +1755,9 @@ del_range_2 (ptrdiff_t from, ptrdiff_t from_byte, return deletion; } - -/* Call this if you're about to change the region of BUFFER from - character positions START to END. This checks the read-only + +/* Call this if you're about to change the region of current buffer + from character positions START to END. This checks the read-only properties of the region, calls the necessary modification hooks, and warns the next redisplay that it should pay attention to that area. @@ -1766,16 +1766,11 @@ del_range_2 (ptrdiff_t from, ptrdiff_t from_byte, Otherwise set CHARS_MODIFF to the new value of MODIFF. */ void -modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end, - bool preserve_chars_modiff) +modify_region_1 (ptrdiff_t start, ptrdiff_t end, bool preserve_chars_modiff) { - struct buffer *old_buffer = current_buffer; - - set_buffer_internal (buffer); - prepare_to_modify_buffer (start, end, NULL); - BUF_COMPUTE_UNCHANGED (buffer, start - 1, end); + BUF_COMPUTE_UNCHANGED (current_buffer, start - 1, end); if (MODIFF <= SAVE_MODIFF) record_first_change (); @@ -1783,11 +1778,9 @@ modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end, if (! preserve_chars_modiff) CHARS_MODIFF = MODIFF; - bset_point_before_scroll (buffer, Qnil); - - set_buffer_internal (old_buffer); + bset_point_before_scroll (current_buffer, Qnil); } - + /* Check that it is okay to modify the buffer between START and END, which are char positions. |