(char-feature-name-at-domain): New function.
authorMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Thu, 18 Mar 2010 12:12:14 +0000 (21:12 +0900)
committerMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Thu, 18 Mar 2010 12:12:14 +0000 (21:12 +0900)
(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

index 45f1957..bb339a6 100644 (file)
                " (" (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
 ;;;
            (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))))
                                      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
 (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