(ids-format-unit): New function.
authortomo <tomo>
Fri, 5 Apr 2002 11:30:21 +0000 (11:30 +0000)
committertomo <tomo>
Fri, 5 Apr 2002 11:30:21 +0000 (11:30 +0000)
(ids-format-list): New function.

ids.el

diff --git a/ids.el b/ids.el
index da4101e..9948d39 100644 (file)
--- a/ids.el
+++ b/ids.el
     (if (= (length (cdr ret)) 0)
        (car ret))))
 
+(defun ids-format-unit (ids-char)
+  (let (ret)
+    (cond ((characterp ids-char)
+          (char-to-string ids-char))
+         ((integerp ids-char)
+          (char-to-string (decode-char 'ucs ids-char)))
+         ((setq ret (find-char ids-char))
+          (char-to-string ret))
+         ((setq ret (assq 'ideographic-structure ids-char))
+          (ids-format-list (cdr ret))))))
+
+(defun ids-format-list (ids-list)
+  (mapconcat (lambda (cell)
+              (ids-format-unit
+               (if (char-ref-p cell)
+                   (plist-get cell :char)
+                 cell)))
+            ids-list ""))
+                    
 
 ;;; @ End.
 ;;;