From 2789af432e6c76b2f7e9ec4d6bc81882df903a30 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Thu, 8 Apr 2010 08:15:25 +0900 Subject: [PATCH] (www-feature-format): New function. (www-format-eval-unit): Support `:feature' property for `value' related functions and `name' function. --- cwiki-common.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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" -- 1.7.10.4