From: MORIOKA Tomohiko Date: Wed, 7 Apr 2010 23:15:25 +0000 (+0900) Subject: (www-feature-format): New function. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2789af432e6c76b2f7e9ec4d6bc81882df903a30;p=chise%2Fest.git (www-feature-format): New function. (www-format-eval-unit): Support `:feature' property for `value' related functions and `name' function. --- diff --git a/cwiki-common.el b/cwiki-common.el index a3e2ee0..72103fe 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -47,6 +47,18 @@ 'structure) )))) +(defun www-feature-format (feature-name) + (or (char-feature-property feature-name 'format) + (let (fn parent ret) + (setq fn feature-name) + (while (and (setq parent (char-feature-name-parent fn)) + (null (setq ret + (char-feature-property + parent 'format)))) + (setq fn parent)) + ret) + '((name) " : " (value)))) + (defun www-feature-value-format (feature-name) (or (char-feature-property feature-name 'value-format) (let (fn parent ret) @@ -954,6 +966,12 @@ (cond ((memq (car exp) '(value decimal hex HEX ku-ten kangxi-radical S-exp string default)) + (let ((fn (plist-get (nth 1 exp) :feature))) + (when fn + (when (stringp fn) + (setq fn (intern fn))) + (setq feature-name fn + value (www-char-feature char feature-name)))) (if (eq (car exp) 'value) (www-format-eval-feature-value char feature-name (plist-get (nth 1 exp) :format) @@ -966,6 +984,12 @@ without-tags without-edit)) ) ((eq (car exp) 'name) + (let ((fn (plist-get (nth 1 exp) :feature))) + (when fn + (setq feature-name + (if (stringp fn) + (intern fn) + fn)))) (if without-tags (www-format-feature-name feature-name lang) (format "%s"