changeset 75788:9099b36e6499

(titdic-convert): Force files be written with Unix-like eol format. Read files under CXTERM-DIC by raw-text. (miscdic-convert): Force files be written with Unix-like eol format.
author Kenichi Handa <handa@m17n.org>
date Sun, 11 Feb 2007 02:32:53 +0000
parents db90b43ef87e
children 1f8dabc6e53d
files lisp/international/titdic-cnv.el
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/titdic-cnv.el	Sun Feb 11 02:30:55 2007 +0000
+++ b/lisp/international/titdic-cnv.el	Sun Feb 11 02:32:53 2007 +0000
@@ -471,13 +471,16 @@
 Optional argument DIRNAME if specified is the directory name under which
 the generated Quail package is saved."
   (interactive "FTIT dictionary file: ")
-  (let ((coding-system-for-write 'iso-2022-7bit))
+  (let ((coding-system-for-write 'iso-2022-7bit-unix))
     (with-temp-file  (tit-make-quail-package-file-name filename dirname)
-      (set-buffer-file-coding-system 'iso-2022-7bit)
+      ;; Explicitly speficy eol format to `unix'.
+      (set-buffer-file-coding-system 'iso-2022-7bit-unix)
       (let ((standard-output (current-buffer)))
 	(with-temp-buffer
 	  (set-buffer-multibyte nil)
-	  (let ((coding-system-for-read 'no-conversion))
+	  ;; Here we must use `raw-text' instead of `no-conversion' to
+	  ;; enable auto-decoding of eol format (CRLF->LF).
+	  (let ((coding-system-for-read 'raw-text))
 	    (insert-file-contents (expand-file-name filename)))
 
 	  ;; Decode the buffer contents from the encoding specified by a
@@ -1145,7 +1148,8 @@
 	      copyright (nth 6 slot))
 	(message "Converting %s to %s..." dicfile quailfile)
 	(with-temp-file (expand-file-name quailfile dirname)
-	  (set-buffer-file-coding-system 'iso-2022-7bit)
+	  ;; Explicitly speficy eol format to `unix'.
+	  (set-buffer-file-coding-system 'iso-2022-7bit-unix)
 	  (insert ";; Quail package `" name "' -*- coding:iso-2022-7bit; ")
 	  (insert "byte-compile-disable-print-circle:t; -*-\n");
 	  (insert ";;   Generated by the command `miscdic-convert'\n")