* erc-stamp.el (erc-echo-timestamp):
[bpt/emacs.git] / lisp / international / ja-dic-cnv.el
index 3b1eaeb..d7add6f 100644 (file)
@@ -1,7 +1,9 @@
-;;; ja-dic-cnv.el --- Convert a Japanese dictionary (SKK-JISYO.L) to Emacs Lisp
+;;; ja-dic-cnv.el --- convert a Japanese dictionary (SKK-JISYO.L) to Emacs Lisp
 
-;; Copyright (C) 1995, 2000 Electrotechnical Laboratory, JAPAN.
-;; Licensed to the Free Software Foundation.
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+;;   2005, 2006, 2007
+;;   National Institute of Advanced Industrial Science and Technology (AIST)
+;;   Registration Number H14PRO021
 
 ;; Keywords: mule, multilingual, Japanese
 
@@ -9,7 +11,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -19,8 +21,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
   (save-excursion
     (set-buffer buf)
     (insert ")\n\n")))
-         
+
 (defconst skkdic-prefix-list '(skkdic-prefix-list))
 
 (defun skkdic-convert-prefix (skkbuf buf)
   (save-excursion
     (set-buffer buf)
     (insert ")\n\n")))
-         
+
 ;; FROM and TO point the head and tail of "/J../J../.../".
 (defun skkdic-get-candidate-list (from to)
   (let (candidates)
     (goto-char from)
-    (while (re-search-forward "/\\cj+" to t)
+    (while (re-search-forward "/[^/ \n]+" to t)
       (setq candidates (cons (buffer-substring (1+ (match-beginning 0))
                                               (match-end 0))
                             candidates)))
 ;; Return t if substring of STR (between FROM and TO) can be broken up
 ;; to chunks all of which can be derived from another entry in SKK
 ;; dictionary.  SKKBUF is the buffer where the original SKK dictionary
-;; is visited, KANA is the current entry for STR.  FIRST is t iff this
-;; is called at top level.
+;; is visited, KANA is the current entry for STR.  FIRST is t only if
+;; this is called at top level.
 
 (defun skkdic-breakup-string (skkbuf kana str from to &optional first)
   (let ((len (- to from)))
       (setq candidates (cdr candidates)))
     (nreverse l)))
 
-(defconst skkdic-okuri-nasi-entries (list nil))
-(defconst skkdic-okuri-nasi-entries-count 0)
+(defvar skkdic-okuri-nasi-entries (list nil))
+(defvar skkdic-okuri-nasi-entries-count 0)
 
 (defun skkdic-collect-okuri-nasi ()
   (message "Collecting OKURI-NASI entries ...")
     (insert ")\n\n")))
 
 (defun skkdic-convert (filename &optional dirname)
-  "Generate Emacs lisp file form Japanese dictionary file FILENAME.
+  "Generate Emacs Lisp file form Japanese dictionary file FILENAME.
 The format of the dictionary file should be the same as SKK dictionaries.
 Optional argument DIRNAME if specified is the directory name under which
 the generated Emacs Lisp is saved.
@@ -358,13 +360,15 @@ The name of generated file is specified by the variable `ja-dic-filename'."
       (set-buffer buf)
       (erase-buffer)
       (buffer-disable-undo)
-      (insert ";; ja-dic.el -- dictionary for Japanese input method\n"
+      (insert ";;; ja-dic.el --- dictionary for Japanese input method"
+             " -*-coding: iso-2022-jp; byte-compile-disable-print-circle:t; -*-\n"
              ";;\tGenerated by the command `skkdic-convert'\n"
              ";;\tDate: " (current-time-string) "\n"
              ";;\tOriginal SKK dictionary file: "
-             (file-name-nondirectory filename)
+             (file-relative-name (expand-file-name filename) dirname)
              "\n\n"
-             ";;; Comment:\n\n"
+             ";; This file is part of GNU Emacs.\n\n"
+             ";;; Commentary:\n\n"
              ";; Do byte-compile this file again after any modification.\n\n"
              ";;; Start of the header of the original SKK dictionary.\n\n")
       (set-buffer skkbuf)
@@ -405,7 +409,7 @@ The name of generated file is specified by the variable `ja-dic-filename'."
        (goto-char to)
        (skkdic-convert-prefix skkbuf buf)
 
-       ;; 
+       ;;
        (skkdic-collect-okuri-nasi)
 
        ;; Convert okuri-nasi general entries.
@@ -415,7 +419,7 @@ The name of generated file is specified by the variable `ja-dic-filename'."
        (save-excursion
          (set-buffer buf)
          (goto-char (point-max))
-         (insert ";;\n(provide 'ja-dic)\n\n;; ja-dic.el ends here\n")))
+         (insert ";;\n(provide 'ja-dic)\n\n;;; ja-dic.el ends here\n")))
 
       ;; Save the working buffer.
       (set-buffer buf)
@@ -554,7 +558,7 @@ To get complete usage, invoke:
         (while l
           (setq count (1+ count))
           (if (= (% count 10000) 0)
-              (message (format "%d entries" count)))
+              (message "%d entries" count))
           (setq entry (skkdic-extract-conversion-data (car l)))
           (set-nested-alist (car entry) (cdr entry) map)
           (setq l (cdr l)))
@@ -562,4 +566,9 @@ To get complete usage, invoke:
 
 (provide 'ja-dic-cnv)
 
-;; ja-dic-cnv.el ends here
+;; Local Variables:
+;; coding: iso-2022-7bit
+;; End:
+
+;;; arch-tag: dec06fb0-8118-45b1-80d7-dc360b6fd3b2
+;;; ja-dic-cnv.el ends here