diff src/editfns.c @ 72592:f6de516bbb4b

* 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.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 01 Sep 2006 13:28:13 +0000
parents ad48859287a7
children d8f99fba05ca c358d0861b16
line wrap: on
line diff
--- a/src/editfns.c	Fri Sep 01 08:57:41 2006 +0000
+++ b/src/editfns.c	Fri Sep 01 13:28:13 2006 +0000
@@ -2781,7 +2781,7 @@
 	  else if (!changed)
 	    {
 	      changed = -1;
-	      modify_region (current_buffer, pos, XINT (end));
+	      modify_region (current_buffer, pos, XINT (end), 0);
 
 	      if (! NILP (noundo))
 		{
@@ -2897,7 +2897,7 @@
   pos = XINT (start);
   pos_byte = CHAR_TO_BYTE (pos);
   end_pos = XINT (end);
-  modify_region (current_buffer, pos, XINT (end));
+  modify_region (current_buffer, pos, XINT (end), 0);
 
   cnt = 0;
   for (; pos < end_pos; )
@@ -4168,7 +4168,7 @@
 
   if (end1 == start2)		/* adjacent regions */
     {
-      modify_region (current_buffer, start1, end2);
+      modify_region (current_buffer, start1, end2, 0);
       record_change (start1, len1 + len2);
 
       tmp_interval1 = copy_intervals (cur_intv, start1, len1);
@@ -4224,8 +4224,8 @@
         {
 	  USE_SAFE_ALLOCA;
 
-          modify_region (current_buffer, start1, end1);
-          modify_region (current_buffer, start2, end2);
+          modify_region (current_buffer, start1, end1, 0);
+          modify_region (current_buffer, start2, end2, 0);
           record_change (start1, len1);
           record_change (start2, len2);
           tmp_interval1 = copy_intervals (cur_intv, start1, len1);
@@ -4254,7 +4254,7 @@
         {
 	  USE_SAFE_ALLOCA;
 
-          modify_region (current_buffer, start1, end2);
+          modify_region (current_buffer, start1, end2, 0);
           record_change (start1, (end2 - start1));
           tmp_interval1 = copy_intervals (cur_intv, start1, len1);
           tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);
@@ -4285,7 +4285,7 @@
 	  USE_SAFE_ALLOCA;
 
           record_change (start1, (end2 - start1));
-          modify_region (current_buffer, start1, end2);
+          modify_region (current_buffer, start1, end2, 0);
 
           tmp_interval1 = copy_intervals (cur_intv, start1, len1);
           tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);