;;; ids-dump.el --- Dump utility of IDS-* files
-;; Copyright (C) 2002,2003 MORIOKA Tomohiko
+;; Copyright (C) 2002,2003,2004,2005,2009 MORIOKA Tomohiko
;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
;; Keywords: IDS, IDC, Ideographs, UCS, Unicode
(require 'ids)
+(defun ids-dump-format-list (ids-list)
+ (if ids-list
+ (let (ucs)
+ (mapconcat
+ (lambda (c)
+ (char-to-string
+ (if (setq ucs
+ (unless (encode-char c '=ucs 'defined-only)
+ (or (get-char-attribute c '=ucs@unicode)
+ (get-char-attribute c '=ucs@iso))))
+ (decode-char '=ucs ucs)
+ c)))
+ (ids-format-list ids-list) ""))))
+
(defun ids-dump-insert-line (ccs line-spec code)
(let ((chr (decode-char ccs code))
id-list)
(insert (format line-spec
code (decode-builtin-char ccs code)
(if id-list
- (ids-format-list id-list)
+ (ids-dump-format-list id-list)
(char-to-string chr)))))))
(defun ids-dump-insert-ccs-ranges (ccs line-spec &rest ranges)
(insert
(format "M-%05d \t%c\t%s\n"
i (decode-builtin-char 'ideograph-daikanwa i)
- (or (ids-format-list
+ (or (ids-dump-format-list
(get-char-attribute chr 'ideographic-structure))
""))))
(when (setq sal (assq i mdh-alist))
(insert
(format "M-%05d'\t%c\t%s\n"
i chr
- (or (ids-format-list
+ (or (ids-dump-format-list
(get-char-attribute chr 'ideographic-structure))
""))))
(when (setq chr (assq 2 sal))
(insert
(format "M-%05d\"\t%c\t%s\n"
i chr
- (ids-format-list
+ (ids-dump-format-list
(get-char-attribute chr 'ideographic-structure)))))
)
(setq i (1+ i)))))
(format "MH-%04d \t%c\t%s\n"
(car cell)
chr
- (or (ids-format-list
+ (or (ids-dump-format-list
(get-char-attribute chr 'ideographic-structure))
""))))))
h l
(decode-builtin-char 'japanese-jisx0208-1990
(logior (lsh h 8) l))
- (or (ids-format-list
+ (or (ideographic-structure-to-ids
(get-char-attribute chr 'ideographic-structure))
"")))
(setq cell (1+ cell)))
h l
(decode-builtin-char 'japanese-jisx0208-1990
(logior (lsh h 8) l))
- (or (ids-format-list
+ (or (ideographic-structure-to-ids
(get-char-attribute chr 'ideographic-structure))
"")))
(setq cell (1+ cell)))))