aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2005-09-23 07:06:22 +0000
committerKenichi Handa2005-09-23 07:06:22 +0000
commitc02d943bc2b0cceeb2b0db7503e74a8232333ea9 (patch)
treeaef27a50b84b7c2473c341f1cd02fbd1259ebb2b /src/coding.c
parent63cf84d615261627edcbb1fc523396adfcf74f5a (diff)
downloademacs-c02d943bc2b0cceeb2b0db7503e74a8232333ea9.tar.gz
emacs-c02d943bc2b0cceeb2b0db7503e74a8232333ea9.zip
(encode_coding_object): If a pre-write-conversion
function makes a new buffer, kill it.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c
index 93051d2f8a3..15130b90719 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6887,6 +6887,7 @@ encode_coding_object (coding, src_object, from, from_byte, to, to_byte,
6887 Lisp_Object attrs; 6887 Lisp_Object attrs;
6888 Lisp_Object buffer; 6888 Lisp_Object buffer;
6889 int saved_pt = -1, saved_pt_byte; 6889 int saved_pt = -1, saved_pt_byte;
6890 int kill_src_buffer = 0;
6890 6891
6891 buffer = Fcurrent_buffer (); 6892 buffer = Fcurrent_buffer ();
6892 6893
@@ -6924,6 +6925,8 @@ encode_coding_object (coding, src_object, from, from_byte, to, to_byte,
6924 args[2] = make_number (Z); 6925 args[2] = make_number (Z);
6925 safe_call (3, args); 6926 safe_call (3, args);
6926 } 6927 }
6928 if (XBUFFER (coding->src_object) != current_buffer)
6929 kill_src_buffer = 1;
6927 coding->src_object = Fcurrent_buffer (); 6930 coding->src_object = Fcurrent_buffer ();
6928 if (BEG != GPT) 6931 if (BEG != GPT)
6929 move_gap_both (BEG, BEG_BYTE); 6932 move_gap_both (BEG, BEG_BYTE);
@@ -7026,6 +7029,8 @@ encode_coding_object (coding, src_object, from, from_byte, to, to_byte,
7026 saved_pt_byte + (coding->produced - bytes)); 7029 saved_pt_byte + (coding->produced - bytes));
7027 } 7030 }
7028 7031
7032 if (kill_src_buffer)
7033 Fkill_buffer (coding->src_object);
7029 unbind_to (count, Qnil); 7034 unbind_to (count, Qnil);
7030} 7035}
7031 7036