From 259b68cd8c0f3006d7b28e6701220bcde9632bda Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Fri, 14 Dec 2018 19:53:08 +0900 Subject: [PATCH] (chise-turtle-encode-char): New implementation; use `char-attribute-alist'; don't use `est-coded-charset-priority-list'. --- concord-turtle-dump.el | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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) ) -- 1.7.10.4