From: MORIOKA Tomohiko Date: Fri, 14 Dec 2018 10:53:08 +0000 (+0900) Subject: (chise-turtle-encode-char): New implementation; use X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=259b68cd8c0f3006d7b28e6701220bcde9632bda;p=chise%2Fchiset.git (chise-turtle-encode-char): New implementation; use `char-attribute-alist'; don't use `est-coded-charset-priority-list'. --- diff --git a/concord-turtle-dump.el b/concord-turtle-dump.el index f2cedaa..1a835b1 100644 --- a/concord-turtle-dump.el +++ b/concord-turtle-dump.el @@ -290,13 +290,20 @@ code-point)))) (defun chise-turtle-encode-char (object) - (let ((ccs-list est-coded-charset-priority-list) + (let (spec cell dest ccs ret ret2) (if (setq ret (encode-char object '=ucs)) (chise-turtle-format-ccs-code-point '=ucs ret) - (while (and ccs-list - (setq ccs (pop ccs-list)) - (not (setq ret (encode-char object ccs 'defined-only))))) + (setq spec (char-attribute-alist object)) + (while (and spec + (setq cell (pop spec))) + (if (and (find-charset (car cell)) + (setq ret (cdr cell))) + (setq dest (cons cell dest)))) + (setq ret (car (sort dest (lambda (a b) + (char-attribute-name< (car a)(car b))))) + ccs (car ret) + ret (cdr ret)) (cond (ret (chise-turtle-format-ccs-code-point ccs ret) )