(char-db-insert-char-spec): Refer `char-db-ignored-attributes'; add
[chise/xemacs-chise.git-] / lisp / utf-2000 / char-db-util.el
index 50996cb..55b26b9 100644 (file)
@@ -1,6 +1,6 @@
 ;;; char-db-util.el --- Character Database utility
 
-;; Copyright (C) 1998,1999,2000,2001 MORIOKA Tomohiko.
+;; Copyright (C) 1998,1999,2000,2001,2002 MORIOKA Tomohiko.
 
 ;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
 ;; Keywords: UTF-2000, ISO/IEC 10646, Unicode, UCS-4, MULE.
                       t)))
                 (if (charset-iso-final-char kb)
                     nil
-                  (> (charset-id ka)(charset-id kb)))))
+                  (< (charset-id ka)(charset-id kb)))))
              ((<= (charset-chars ka)(charset-chars kb)))))
        (t
        (< (charset-dimension ka)
                       arabic-digit
                       arabic-1-column
                       arabic-2-column)))
+             ((string-match "^mojikyo-" (symbol-name (car rest))))
              ((string-match "^ideograph-gt-pj-" (symbol-name (car rest)))
               (unless (memq 'ideograph-gt dest)
                 (setq dest (cons 'ideograph-gt dest))))
          cal nil)
     (while char-spec
       (setq key (car (car char-spec)))
-      (if (find-charset key)
-         (setq cal (cons key cal))
-       (setq al (cons key al)))
+      (unless (memq key char-db-ignored-attributes)
+       (if (find-charset key)
+           (setq cal (cons key cal))
+         (setq al (cons key al))))
       (setq char-spec (cdr char-spec)))
+    (unless (or cal
+               (memq 'ideographic-structure al))
+      (push 'ideographic-structure al))
     (insert-char-attributes char
                            readable
                            (or al 'none) cal)
 
 (defvar char-db-convert-obsolete-format t)
 
+(defvar char-db-ignored-attributes nil)
+
 (defun insert-char-attributes (char &optional readable
                                    attributes ccs-attributes
                                    column)
     (setq attributes
          (sort (if attributes
                    (if (consp attributes)
-                       (copy-sequence attributes))
+                       (progn
+                         (dolist (name attributes)
+                           (unless (memq name char-db-ignored-attributes)
+                             (push name atr-d)))
+                         atr-d))
                  (dolist (name (char-attribute-list))
-                   (if (find-charset name)
-                       (push name ccs-d)
-                     (push name atr-d)))
+                   (unless (memq name char-db-ignored-attributes)
+                     (if (find-charset name)
+                         (push name ccs-d)
+                       (push name atr-d))))
                  atr-d)
                #'char-attribute-name<))
     (setq ccs-attributes
          (sort (if ccs-attributes
-                   (copy-sequence ccs-attributes)
+                   (progn
+                     (setq ccs-d nil)
+                     (dolist (name ccs-attributes)
+                       (unless (memq name char-db-ignored-attributes)
+                         (push name ccs-d)))
+                     ccs-d)
                  (or ccs-d
-                     (charset-list)))
+                     (progn
+                       (dolist (name (charset-list))
+                         (unless (memq name char-db-ignored-attributes)
+                           (push name ccs-d)))
+                       ccs-d)))
                #'char-attribute-name<)))
   (unless column
     (setq column (current-column)))
                      line-breaking))
       (setq attributes (delq '=>ucs* attributes))
       )
+    (when (and (memq '=>ucs-jis attributes)
+              (setq value (get-char-attribute char '=>ucs-jis)))
+      (insert (format "(=>ucs-jis\t\t. #x%04X)\t; %c%s"
+                     value (decode-char 'ucs value)
+                     line-breaking))
+      (setq attributes (delq '=>ucs-jis attributes))
+      )
     (when (and (memq '->ucs attributes)
               (setq value (get-char-attribute char '->ucs)))
       (insert (format (if char-db-convert-obsolete-format
                      line-breaking))
       (setq attributes (delq 'morohashi-daikanwa attributes))
       )
+    ;; (when (and (memq 'hanyu-dazidian attributes)
+    ;;            (setq value (get-char-attribute char 'hanyu-dazidian)))
+    ;;   (insert (format "(hanyu-dazidian     %s)%s"
+    ;;                   (mapconcat #'number-to-string value " ")
+    ;;                   line-breaking))
+    ;;   (setq attributes (delq 'hanyu-dazidian attributes))
+    ;;   )
     (setq radical nil
          strokes nil)
     (when (and (memq 'ideographic-radical attributes)
               (setq value (get-char-attribute char name)))
          (insert
           (format
-           (cond ((memq name '(ideograph-daikanwa ideograph-gt
-                                                  ideograph-cbeta))
+           (cond ((memq name '(ideograph-daikanwa-2
+                               ideograph-daikanwa
+                               ideograph-gt
+                               ideograph-cbeta))
                   (if has-long-ccs-name
                       "(%-26s . %05d)\t; %c%s"
                     "(%-18s . %05d)\t; %c%s"))
          (insert-char-data-with-variant char 'printable)
          (unless (char-attribute-alist char)
            (insert (format ";; = %c\n"
-                           (apply #'make-char (split-char char)))))
+                           (let* ((rest (split-char char))
+                                  (ccs (pop rest))
+                                  (code (pop rest)))
+                             (while rest
+                               (setq code (logior (lsh code 8)
+                                                  (pop rest))))
+                             (decode-char ccs code)))))
           ;; (char-db-update-comment)
          (set-buffer-modified-p nil)
          (view-mode the-buf (lambda (buf)