aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-08-06 09:30:18 +0400
committerDmitry Antipov2013-08-06 09:30:18 +0400
commit00012b86257f33dd4e08e79b814f4a7ad6010713 (patch)
tree1f01b7ccab453278d5e697ae2bf3dd34cd119a48 /src/editfns.c
parent307764cc3a2afd363cae0a36a6d18dfa68788cb4 (diff)
downloademacs-00012b86257f33dd4e08e79b814f4a7ad6010713.tar.gz
emacs-00012b86257f33dd4e08e79b814f4a7ad6010713.zip
Invalidate region caches only if buffer text is going to be changed.
* lisp.h (modify_region_1): Remove 3rd arg and rename to... (modify_text): ...new prototype. (prepare_to_modify_buffer_1): New prototype. * textprop.c (modify_region): Rename to... (modify_text_properties): ...new function. (add_text_properties_1, set_text_properties, Fremove_text_properties) (Fremove_list_of_text_properties): Adjust users. * insdel.c (modify_region_1): Remove 3rd arg and reimplement as... (modify_text): ...new function. (prepare_to_modify_buffer): Reimplement mostly as a wrapper for... (prepare_to_modify_buffer_1): ...new function. * casefiddle.c (casify_region): * editfns.c (Fsubst_char_in_region, Ftranslate_region_internal) (Ftranspose_regions): Use modify_text.
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 50bde90788d..90346a88eb2 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2928,7 +2928,7 @@ Both characters must have the same length of multi-byte form. */)
2928 else if (!changed) 2928 else if (!changed)
2929 { 2929 {
2930 changed = -1; 2930 changed = -1;
2931 modify_region_1 (pos, XINT (end), false); 2931 modify_text (pos, XINT (end));
2932 2932
2933 if (! NILP (noundo)) 2933 if (! NILP (noundo))
2934 { 2934 {
@@ -3104,7 +3104,7 @@ It returns the number of characters changed. */)
3104 pos = XINT (start); 3104 pos = XINT (start);
3105 pos_byte = CHAR_TO_BYTE (pos); 3105 pos_byte = CHAR_TO_BYTE (pos);
3106 end_pos = XINT (end); 3106 end_pos = XINT (end);
3107 modify_region_1 (pos, end_pos, false); 3107 modify_text (pos, end_pos);
3108 3108
3109 cnt = 0; 3109 cnt = 0;
3110 for (; pos < end_pos; ) 3110 for (; pos < end_pos; )
@@ -4615,7 +4615,7 @@ Transposing beyond buffer boundaries is an error. */)
4615 4615
4616 if (end1 == start2) /* adjacent regions */ 4616 if (end1 == start2) /* adjacent regions */
4617 { 4617 {
4618 modify_region_1 (start1, end2, false); 4618 modify_text (start1, end2);
4619 record_change (start1, len1 + len2); 4619 record_change (start1, len1 + len2);
4620 4620
4621 tmp_interval1 = copy_intervals (cur_intv, start1, len1); 4621 tmp_interval1 = copy_intervals (cur_intv, start1, len1);
@@ -4674,8 +4674,8 @@ Transposing beyond buffer boundaries is an error. */)
4674 { 4674 {
4675 USE_SAFE_ALLOCA; 4675 USE_SAFE_ALLOCA;
4676 4676
4677 modify_region_1 (start1, end1, false); 4677 modify_text (start1, end1);
4678 modify_region_1 (start2, end2, false); 4678 modify_text (start2, end2);
4679 record_change (start1, len1); 4679 record_change (start1, len1);
4680 record_change (start2, len2); 4680 record_change (start2, len2);
4681 tmp_interval1 = copy_intervals (cur_intv, start1, len1); 4681 tmp_interval1 = copy_intervals (cur_intv, start1, len1);
@@ -4708,7 +4708,7 @@ Transposing beyond buffer boundaries is an error. */)
4708 { 4708 {
4709 USE_SAFE_ALLOCA; 4709 USE_SAFE_ALLOCA;
4710 4710
4711 modify_region_1 (start1, end2, false); 4711 modify_text (start1, end2);
4712 record_change (start1, (end2 - start1)); 4712 record_change (start1, (end2 - start1));
4713 tmp_interval1 = copy_intervals (cur_intv, start1, len1); 4713 tmp_interval1 = copy_intervals (cur_intv, start1, len1);
4714 tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid); 4714 tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);
@@ -4741,7 +4741,7 @@ Transposing beyond buffer boundaries is an error. */)
4741 USE_SAFE_ALLOCA; 4741 USE_SAFE_ALLOCA;
4742 4742
4743 record_change (start1, (end2 - start1)); 4743 record_change (start1, (end2 - start1));
4744 modify_region_1 (start1, end2, false); 4744 modify_text (start1, end2);
4745 4745
4746 tmp_interval1 = copy_intervals (cur_intv, start1, len1); 4746 tmp_interval1 = copy_intervals (cur_intv, start1, len1);
4747 tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid); 4747 tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);