changeset 90231:8be9e4c6d687

(encode_coding_object): If a pre-write-conversion function makes a new buffer, kill it.
author Kenichi Handa <handa@m17n.org>
date Fri, 23 Sep 2005 07:06:22 +0000
parents fa744c8b8632
children eab32348047a
files src/coding.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/coding.c	Mon Sep 19 11:14:02 2005 +0000
+++ b/src/coding.c	Fri Sep 23 07:06:22 2005 +0000
@@ -6887,6 +6887,7 @@
   Lisp_Object attrs;
   Lisp_Object buffer;
   int saved_pt = -1, saved_pt_byte;
+  int kill_src_buffer = 0;
 
   buffer = Fcurrent_buffer ();
 
@@ -6924,6 +6925,8 @@
 	args[2] = make_number (Z);
 	safe_call (3, args);
       }
+      if (XBUFFER (coding->src_object) != current_buffer)
+	kill_src_buffer = 1;
       coding->src_object = Fcurrent_buffer ();
       if (BEG != GPT)
 	move_gap_both (BEG, BEG_BYTE);
@@ -7026,6 +7029,8 @@
 			  saved_pt_byte + (coding->produced - bytes));
     }
 
+  if (kill_src_buffer)
+    Fkill_buffer (coding->src_object);
   unbind_to (count, Qnil);
 }