From b92cc94229ab07922c1249bb1033484ec96e0e29 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Thu, 18 Mar 2010 21:12:14 +0900 Subject: [PATCH] (char-feature-name-at-domain): New function. (www-char-feature): New function. (www-format-encode-string): Use `www-char-feature' instead of `char-feature'. (www-format-eval-feature-value): Likewise. (www-format-eval-unit): Likewise. --- cwiki-common.el | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/cwiki-common.el b/cwiki-common.el index 45f1957..bb339a6 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -55,6 +55,22 @@ " (" (decimal) ") <" (ku-ten) ">") '("0x" (HEX) " (" (decimal) ")"))))) +(defun char-feature-name-at-domain (feature-name domain) + (let ((name (symbol-name feature-name))) + (cond + ((string-match "@[^*]+$" name) + (intern (format "%s/%s" name domain)) + ) + (t + (intern (format "%s@%s" name domain)) + )))) + +(defun www-char-feature (character feature) + (let ((latest-feature (char-feature-name-at-domain feature '$rev=latest))) + (mount-char-attribute-table latest-feature) + (or (char-feature character latest-feature) + (char-feature character feature)))) + ;;; @ URI representation ;;; @@ -507,8 +523,8 @@ (setq start (match-beginning 0) end (match-end 0)) (setq char (decode-char 'system-char-id code)) - (setq variants (or (char-feature char '->subsumptive) - (char-feature char '->denotational))) + (setq variants (or (www-char-feature char '->subsumptive) + (www-char-feature char '->denotational))) (while (and variants (setq ret (www-format-encode-string (char-to-string (car variants)))) @@ -583,7 +599,7 @@ feature-name &optional format lang uri-char value) (unless value - (setq value (char-feature char feature-name))) + (setq value (www-char-feature char feature-name))) (unless format (setq format (www-feature-value-format feature-name))) (cond @@ -606,7 +622,7 @@ (defun www-format-eval-unit (exp char feature-name &optional lang uri-char value) (unless value - (setq value (char-feature char feature-name))) + (setq value (www-char-feature char feature-name))) (unless uri-char (setq uri-char (www-uri-encode-char char))) (cond -- 1.7.10.4