changeset 80312:339dff977be0

(Finsert_file_contents): Don't make CCL program to append "CCL: Quitted" when the decoding is quitted, but just signal `quit'.
author Kenichi Handa <handa@m17n.org>
date Mon, 10 Mar 2008 12:19:35 +0000
parents 23dc6fc4bf91
children 39ead84da0d8
files src/fileio.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Mon Mar 10 12:18:02 2008 +0000
+++ b/src/fileio.c	Mon Mar 10 12:19:35 2008 +0000
@@ -4632,8 +4632,19 @@
     {
       if (CODING_MAY_REQUIRE_DECODING (&coding))
 	{
+	  if (coding.type == coding_type_ccl)
+	    coding.spec.ccl.decoder.quit_silently = 1;
 	  code_convert_region (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted,
 			       &coding, 0, 0);
+	  if (coding.type == coding_type_ccl)
+	    coding.spec.ccl.decoder.quit_silently = 0;
+	  if (coding.result == CODING_FINISH_INTERRUPT)
+	    {
+	      /* Fixme: It is better that we report that the decoding
+		 was interruppted by the user, and the current buffer
+		 contents doesn't reflect the file correctly.  */
+	      Fsignal (Qquit, Qnil);
+	    }
 	  inserted = coding.produced_char;
 	}
       else