diff options
author | Jim Blandy <jimb@redhat.com> | 1993-05-14 14:43:30 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 1993-05-14 14:43:30 +0000 |
commit | 04a759c81b944287c3a826eed57ee56a3bea5c03 (patch) | |
tree | 02784ac68d6821607065eb037f3e97dadc8ec13b /src/insdel.c | |
parent | 6c523803b30c3d41a21ce36fbfb0437bf6ce68e5 (diff) | |
download | emacs-04a759c81b944287c3a826eed57ee56a3bea5c03.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.c | 15 |
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. |