aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorRichard M. Stallman2002-01-11 21:27:54 +0000
committerRichard M. Stallman2002-01-11 21:27:54 +0000
commit72d1a715ee9611f5cf3fbb0417106daecc8addf3 (patch)
treeedb00cc9a2cbfc89af9f3aeb0714f6701856dd08 /src/coding.c
parent2192bd73b12396cfed6dad1859ac49e0701a72b1 (diff)
downloademacs-72d1a715ee9611f5cf3fbb0417106daecc8addf3.tar.gz
emacs-72d1a715ee9611f5cf3fbb0417106daecc8addf3.zip
(code_convert_region): Don't copy old text if undo disabled.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/coding.c b/src/coding.c
index 7b352d169c4..88ff0ca0a83 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5305,6 +5305,7 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
5305 struct coding_system *coding; 5305 struct coding_system *coding;
5306{ 5306{
5307 int len = to - from, len_byte = to_byte - from_byte; 5307 int len = to - from, len_byte = to_byte - from_byte;
5308 int nchars_del = 0, nbytes_del = 0;
5308 int require, inserted, inserted_byte; 5309 int require, inserted, inserted_byte;
5309 int head_skip, tail_skip, total_skip = 0; 5310 int head_skip, tail_skip, total_skip = 0;
5310 Lisp_Object saved_coding_symbol; 5311 Lisp_Object saved_coding_symbol;
@@ -5427,7 +5428,15 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
5427 } 5428 }
5428 5429
5429 if (replace) 5430 if (replace)
5430 deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); 5431 {
5432 if (! EQ (current_buffer->undo_list, Qt))
5433 deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1);
5434 else
5435 {
5436 nchars_del = to - from;
5437 nbytes_del = to_byte - from_byte;
5438 }
5439 }
5431 5440
5432 if (coding->composing != COMPOSITION_DISABLED) 5441 if (coding->composing != COMPOSITION_DISABLED)
5433 { 5442 {
@@ -5719,7 +5728,11 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
5719 } 5728 }
5720 5729
5721 prev_Z = Z; 5730 prev_Z = Z;
5722 adjust_after_replace (from, from_byte, deletion, inserted, inserted_byte); 5731 if (! EQ (current_buffer->undo_list, Qt))
5732 adjust_after_replace (from, from_byte, deletion, inserted, inserted_byte);
5733 else
5734 adjust_after_replace_noundo (from, from_byte, nchars_del, nbytes_del,
5735 inserted, inserted_byte);
5723 inserted = Z - prev_Z; 5736 inserted = Z - prev_Z;
5724 5737
5725 if (!encodep && coding->cmp_data && coding->cmp_data->used) 5738 if (!encodep && coding->cmp_data && coding->cmp_data->used)