From bdbebf32ed6602548e74e6a69fff2ec10283b545 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Mon, 29 Mar 2010 06:32:49 +0900 Subject: [PATCH] (www-format-value-as-kangxi-radical): New function. (www-format-apply-value): Support format `kangxi-radical'. (www-format-eval-unit): Support `kangxi-radical' as a value format. --- cwiki-common.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cwiki-common.el b/cwiki-common.el index d8b628a..7ab7a54 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -398,6 +398,14 @@ value) (www-format-value-as-S-exp value))) +(defun www-format-value-as-kangxi-radical (value) + (if (and (integerp value) + (<= 0 value) + (<= value 214)) + (www-format-encode-string + (format "%c" (ideographic-radical value))) + (www-format-value-as-S-exp value))) + (defun www-format-value (object feature-name &optional value format without-tags) (unless value @@ -626,6 +634,8 @@ without-tags)) ((eq format 'ku-ten) (www-format-value-as-kuten value)) + ((eq format 'kangxi-radical) + (www-format-value-as-kangxi-radical value)) ((eq format 'space-separated-char-list) (www-format-value-as-char-list value without-tags)) ((eq format 'space-separated-ids) @@ -682,7 +692,8 @@ ((null exp) "") ((consp exp) (cond - ((memq (car exp) '(value decimal hex HEX ku-ten S-exp default)) + ((memq (car exp) '(value decimal hex HEX ku-ten kangxi-radical + S-exp default)) (if (eq (car exp) 'value) (www-format-eval-feature-value char feature-name (plist-get (nth 1 exp) :format) -- 1.7.10.4