From 40a45a1caa6e826bb9c46d342d34dec90b49551c Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Tue, 12 Oct 2010 10:12:45 +0900 Subject: [PATCH] (www-display-object-desc): Renamed from `www-display-char-desc'; add new argument `genre'. --- cwiki-view.el | 76 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/cwiki-view.el b/cwiki-view.el index 826503f..075fce9 100644 --- a/cwiki-view.el +++ b/cwiki-view.el @@ -5,28 +5,31 @@ (defvar chise-wiki-edit-url "edit.cgi") (defvar chise-wiki-add-url "add.cgi") -(defun www-display-char-desc (uri-char &optional lang level simple) +(defun www-display-object-desc (genre uri-object &optional lang level simple) (unless level (setq level 1)) - (let ((char (www-uri-decode-char uri-char)) + (let ((object (www-uri-decode-object genre uri-object)) logical-feature chise-wiki-displayed-features parents GlyphWiki-id) - (when (characterp char) - (when (= (length uri-char) 1) - (setq uri-char (www-uri-encode-char char))) + (when object + (when (and (eq genre 'character) + (= (length uri-object) 1)) + (setq uri-object (www-uri-encode-char object))) (when (= level 1) (princ (encode-coding-string (format " -CHISE-wiki character: %s +EsT %s = %s \n" - (decode-uri-string uri-char 'utf-8-mcs-er)) + genre + (decode-uri-string uri-object 'utf-8-mcs-er)) 'utf-8-mcs-er)) (princ "\n")) - (dolist (feature (char-feature-property '$object 'additional-features)) - (mount-char-attribute-table - (char-feature-name-at-domain feature '$rev=latest))) + (when (eq genre 'character) + (dolist (feature (char-feature-property '$object 'additional-features)) + (mount-char-attribute-table + (char-feature-name-at-domain feature '$rev=latest)))) (princ (format (if simple @@ -43,19 +46,20 @@
\n") - uri-char)) - (when (setq parents (www-char-feature char '<-denotational)) + uri-object)) + (when (setq parents (www-get-feature-value object '<-denotational)) (princ (format "

%s %s

\n
\n" (www-format-value-as-char-list parents) (www-format-feature-name '->denotational lang)))) - (when (setq parents (www-char-feature char '<-subsumptive)) + (when (setq parents (www-get-feature-value object '<-subsumptive)) (princ (format "

%s %s

\n
\n" (www-format-value-as-char-list parents) (www-format-feature-name '->subsumptive lang)))) - (setq GlyphWiki-id (char-GlyphWiki-id char)) + (when (eq genre 'character) + (setq GlyphWiki-id (char-GlyphWiki-id object))) (princ (format "%s%s\n" level - (www-format-encode-string (char-to-string char)) + (www-format-encode-string (char-to-string object)) (if GlyphWiki-id (format " \"%s\"" @@ -65,7 +69,9 @@ level)) (if (> level 1) (princ "