From 1a03f51504bf217b64edd6716f3d9d5e47b8021b Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sun, 11 Feb 2007 02:33:56 +0000 Subject: [PATCH] (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. --- lisp/ChangeLog | 8 ++++++++ lisp/international/titdic-cnv.el | 12 ++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4943d6e6285..aaacef8e080 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2007-02-11 Kenichi Handa + + * international/titdic-cnv.el (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. + 2007-02-11 Juanma Barranquero * files.el (change-major-mode-with-file-name): Fix typo in docstring. diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el index c8a1155b0f3..ed5df5b9592 100644 --- a/lisp/international/titdic-cnv.el +++ b/lisp/international/titdic-cnv.el @@ -471,13 +471,16 @@ SPC, 6, 3, 4, or 7 specifing a tone (SPC:$(0?v(N(B, 6:$(0Dm(N(B, 3:$(0&9Vy 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 @@ the generated Quail package is saved." 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") -- 2.39.2