From: MORIOKA Tomohiko Date: Sun, 28 Mar 2010 21:32:49 +0000 (+0900) Subject: (www-format-value-as-kangxi-radical): New function. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdbebf32ed6602548e74e6a69fff2ec10283b545;p=chise%2Fest.git (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. --- 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)