Reformatted.
[chise/xemacs-chise.git.1] / lisp / utf-2000 / update-cdb.el
index efae357..8ee1852 100644 (file)
@@ -1,24 +1,24 @@
 ;;; update-cdb.el --- Update and/or setup character attribute database
 
-;; Copyright (C) 2002 MORIOKA Tomohiko.
+;; Copyright (C) 2002,2003,2004 MORIOKA Tomohiko.
 
 ;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
-;; Keywords: Character, Database, UTF-2000, Unicode, UCS-4, MULE.
+;; Keywords: Character, Database, CHISE, Unicode, UCS-4, MULE.
 
-;; This file is part of XEmacs UTF-2000.
+;; This file is part of XEmacs CHISE.
 
-;; XEmacs UTF-2000 is free software; you can redistribute it and/or
+;; XEmacs CHISE 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) any later version.
 
-;; XEmacs UTF-2000 is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; XEmacs CHISE is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 ;; General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with XEmacs UTF-2000; see the file COPYING.  If not, write to
+;; along with XEmacs CHISE; see the file COPYING.  If not, write to
 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
@@ -37,9 +37,9 @@
 (cond
  ((featurep 'chise)
   (defvar system-char-database-directory
-    (expand-file-name "char-db"
-                     (or exec-directory
-                         "../lib-src/")))
+    (expand-file-name "chise-db"
+                     (or data-directory
+                         "../etc/")))
 
   (defun file-name-char-attribute-name (filename)
     (let ((i 0)
       (save-char-attribute-table attribute))
 
     (dolist (ccs (charset-list))
+      (and (fboundp 'save-charset-properties)
+          (save-charset-properties ccs))
       (save-charset-mapping-table ccs))
+
+    (with-temp-buffer
+      (insert
+       (format
+       "(setq next-defined-char-id #x%X)\n"
+       next-defined-char-id))
+      (write-region (point-min)(point-max)
+                   "../lisp/utf-2000/cid-conf.el"))
     )
    (t
-    (mapcar (lambda (file)
-             (mount-char-attribute-table
-              (intern (file-name-char-attribute-name file))))
-           (directory-files
-            (expand-file-name "system-char-id"
-                              system-char-database-directory)
-            nil nil t t))
+    (if (>= (function-max-args 'char-attribute-list) 1)
+       (char-attribute-list 'rehash)
+      (mapcar (lambda (file)
+               (mount-char-attribute-table
+                (intern (file-name-char-attribute-name file))))
+             (directory-files
+              (expand-file-name "system-char-id" ; "character/feature"
+                                system-char-database-directory)
+              nil nil t t)))
     (dolist (ccs (charset-list))
       (reset-charset-mapping-table ccs))
+    (load "../lisp/utf-2000/cid-conf.el")
     )))
  (t
   (load "dumped-chars.el")