summaryrefslogtreecommitdiff
path: root/src/insdel.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1993-05-14 14:43:30 +0000
committerJim Blandy <jimb@redhat.com>1993-05-14 14:43:30 +0000
commit0d0861f874251bbda4e53932e0b630305f938ab3 (patch)
tree62bfc9ca5be87be2677353e001065e2d88c48286 /src/insdel.c
parentb71a12ded856414d264acf9a27a36ba173b9a2b2 (diff)
downloademacs-0d0861f874251bbda4e53932e0b630305f938ab3.tar.gz
The text property routines can now modify buffers other
than the current one. * insdel.c (modify_region): New argument BUFFER. Select that buffer while we prepare for the modification, and switch back when we're done. * textprop.c (add_properties, remove_properties): Pass the buffer being modified as the first argument to modify_region. * editfns.c (Fsubst_char_in_region, Ftranslate_region): Pass the current_buffer as the first argument to modify_region. * casefiddle.c (casify_region): Same.
Diffstat (limited to 'src/insdel.c')
-rw-r--r--src/insdel.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/insdel.c b/src/insdel.c
index a1b3b1ff113..9d2572bfe62 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -473,9 +473,19 @@ del_range (from, to)
signal_after_change (from, numdel, 0);
}
-modify_region (start, end)
+/* Call this if you're about to change the region of BUFFER from 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. */
+modify_region (buffer, start, end)
+ struct buffer *buffer;
int start, end;
{
+ struct buffer *old_buffer = current_buffer;
+
+ if (buffer != old_buffer)
+ set_buffer_internal (buffer);
+
prepare_to_modify_buffer (start, end);
if (start - 1 < beg_unchanged || unchanged_modified == MODIFF)
@@ -484,6 +494,9 @@ modify_region (start, end)
|| unchanged_modified == MODIFF)
end_unchanged = Z - end;
MODIFF++;
+
+ if (buffer != old_buffer)
+ set_buffer_internal (old_buffer);
}
/* Check that it is okay to modify the buffer between START and END.