From: tomo Date: Fri, 5 Apr 2002 11:30:21 +0000 (+0000) Subject: (ids-format-unit): New function. X-Git-Tag: ids-0_0~12 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=0dfc67331e672392326ec8732629fc7d2ce65738;p=chise%2Fids.git (ids-format-unit): New function. (ids-format-list): New function. --- diff --git a/ids.el b/ids.el index da4101e..9948d39 100644 --- a/ids.el +++ b/ids.el @@ -96,6 +96,25 @@ (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. ;;;