]> code.delx.au - gnu-emacs/blobdiff - lisp/international/ja-dic-cnv.el
Merge from emacs-24 branch; up to 2012-05-01T18:47:23Z!rgm@gnu.org
[gnu-emacs] / lisp / international / ja-dic-cnv.el
index 285a4a9ed03789bae4a5e6801f9a600557b12357..c0fcf19d8414cf1ee9697e191180ada2d16326f0 100644 (file)
@@ -1,7 +1,7 @@
 ;;; ja-dic-cnv.el --- convert a Japanese dictionary (SKK-JISYO.L) to Emacs Lisp
 
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009, 2010
+;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 
 ;; Name of a file to generate from SKK dictionary.
 (defvar ja-dic-filename "ja-dic.el")
 
-;; To make a generated ja-dic.el smaller.
-(define-coding-system 'iso-2022-7bit-short
- "Like `iso-2022-7bit' but no ASCII designation before SPC."
-  :coding-type 'iso-2022
-  :mnemonic ?J
-  :charset-list 'iso-2022
-  :designation [(ascii t) nil nil nil]
-  :flags '(short 7-bit designation))
-
 (defun skkdic-convert-okuri-ari (skkbuf buf)
   (message "Processing OKURI-ARI entries ...")
   (goto-char (point-min))
     (insert ";; Setting okuri-ari entries.\n"
            "(skkdic-set-okuri-ari\n"))
   (while (not (eobp))
-    (let ((from (point))
-         to)
-      (end-of-line)
-      (setq to (point))
-
-      (with-current-buffer buf
-       (insert-buffer-substring skkbuf from to)
-       (beginning-of-line)
-       (insert "\"")
-       (search-forward " ")
-       (delete-char 1)                 ; delete the first '/'
-       (let ((p (point)))
-         (end-of-line)
-         (delete-char -1)              ; delete the last '/'
-         (subst-char-in-region p (point) ?/ ? 'noundo))
-       (insert "\"\n"))
-
-      (forward-line 1)))
+    (if (/= (following-char) ?>)
+       (let ((from (point))
+             (to (line-end-position)))
+         (with-current-buffer buf
+           (insert-buffer-substring skkbuf from to)
+           (beginning-of-line)
+           (insert "\"")
+           (search-forward " ")
+           (delete-char 1)             ; delete the first '/'
+           (let ((p (point)))
+             (end-of-line)
+             (delete-char -1)          ; delete the last '/'
+             (subst-char-in-region p (point) ?/ ? 'noundo))
+           (insert "\"\n"))))
+
+    (forward-line 1))
   (with-current-buffer buf
     (insert ")\n\n")))
 
@@ -348,7 +337,7 @@ The name of generated file is specified by the variable `ja-dic-filename'."
       (erase-buffer)
       (buffer-disable-undo)
       (insert ";;; ja-dic.el --- dictionary for Japanese input method"
-             " -*-coding: iso-2022-jp; byte-compile-disable-print-circle:t; -*-\n"
+             " -*-coding: euc-japan; -*-\n"
              ";;\tGenerated by the command `skkdic-convert'\n"
              ";;\tDate: " (current-time-string) "\n"
              ";;\tOriginal SKK dictionary file: "
@@ -410,7 +399,7 @@ The name of generated file is specified by the variable `ja-dic-filename'."
       ;; Save the working buffer.
       (set-buffer buf)
       (set-visited-file-name (expand-file-name ja-dic-filename dirname) t)
-      (set-buffer-file-coding-system 'iso-2022-7bit-short)
+      (set-buffer-file-coding-system 'euc-japan)
       (save-buffer 0))
     (kill-buffer skkbuf)
     (switch-to-buffer buf)))
@@ -556,5 +545,4 @@ To get complete usage, invoke:
 ;; coding: iso-2022-7bit
 ;; End:
 
-;; arch-tag: dec06fb0-8118-45b1-80d7-dc360b6fd3b2
 ;;; ja-dic-cnv.el ends here