X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Futf-2000%2Fchar-db-util.el;h=55b26b97391813a681d2942e5ba7cfe205dd691a;hb=61c306a4d83670238541bd1135f5b5f7a7d5d4d8;hp=50996cb86e12ab3ec47ac2d119be85ca82529d31;hpb=1a457ecfa8bbb121c48cccd70779a0a23cf95e46;p=chise%2Fxemacs-chise.git- diff --git a/lisp/utf-2000/char-db-util.el b/lisp/utf-2000/char-db-util.el index 50996cb..55b26b9 100644 --- a/lisp/utf-2000/char-db-util.el +++ b/lisp/utf-2000/char-db-util.el @@ -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 ;; Keywords: UTF-2000, ISO/IEC 10646, Unicode, UCS-4, MULE. @@ -125,7 +125,7 @@ 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) @@ -159,6 +159,7 @@ 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)))) @@ -210,10 +211,14 @@ 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) @@ -355,6 +360,8 @@ (defvar char-db-convert-obsolete-format t) +(defvar char-db-ignored-attributes nil) + (defun insert-char-attributes (char &optional readable attributes ccs-attributes column) @@ -362,18 +369,32 @@ (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))) @@ -415,6 +436,13 @@ 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 @@ -506,6 +534,13 @@ 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) @@ -815,8 +850,10 @@ (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")) @@ -958,7 +995,13 @@ (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)