]> code.delx.au - gnu-emacs/blobdiff - src/insdel.c
Remove #definition of HAVE_CLOSEDIR; autoconf figures this out.
[gnu-emacs] / src / insdel.c
index a1b3b1ff113fdff7a756d040c971728ba82bee50..f53d6a76c6a1f925aba931b1ae92133fe618b7e7 100644 (file)
@@ -473,9 +473,19 @@ del_range (from, to)
   signal_after_change (from, numdel, 0);
 }
 \f
-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.
@@ -533,7 +546,7 @@ after_change_function_restore (value)
   Vafter_change_function = value;
 }
 
-/* Signal a change to the buffer immediatly before it happens.
+/* Signal a change to the buffer immediately before it happens.
    START and END are the bounds of the text to be changed,
    as Lisp objects.  */
 
@@ -565,7 +578,7 @@ signal_before_change (start, end)
     }
 }
 
-/* Signal a change immediatly after it happens.
+/* Signal a change immediately after it happens.
    POS is the address of the start of the changed text.
    LENDEL is the number of characters of the text before the change.
    (Not the whole buffer; just the part that was changed.)