(www-display-object-desc): Fix problem when `object' is not a
authorMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Thu, 14 Oct 2010 02:23:12 +0000 (11:23 +0900)
committerMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Thu, 14 Oct 2010 02:23:12 +0000 (11:23 +0900)
character.
(www-batch-view): Support general genres.

cwiki-view.el

index 075fce9..a83e0ec 100644 (file)
        (setq GlyphWiki-id (char-GlyphWiki-id object)))
       (princ (format "<h%d>%s%s</h%d>\n"
                     level
-                    (www-format-encode-string (char-to-string object))
+                    (www-format-encode-string
+                     (if (eq genre 'character)
+                         (char-to-string object)
+                       (format "%s" (concord-object-id object))))
                     (if GlyphWiki-id
                         (format
                          " <a href=\"http://glyphwiki.org/wiki/%s\"><img alt=\"%s\" src=\"http://glyphwiki.org/glyph/%s.50px.png\" /></a>"
        "<form action=\"http://chise.zinbun.kyoto-u.ac.jp/ids-find\">\n")
       (princ
        (www-format-encode-string
-       (format "%c" object)))
+       (if (eq genre 'character)
+           (format "%c" object)
+         (format "%s" (concord-object-id object)))))
       (princ
        (format
        " <input type=\"text\" name=\"components\"
 size=\"30\" maxlength=\"30\" value=\"%s\" />"
-       (encode-coding-string (char-to-string object) 'utf-8-jp-er)))
+       (encode-coding-string
+        (if (eq genre 'character)
+            (char-to-string object)
+          (format "%s" (concord-object-id object)))
+        'utf-8-jp-er)))
       (princ
        (www-format-encode-string
        "を\u542Bむ\u6F22\u5B57を\u63A2す"))
@@ -310,9 +319,16 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />"
                ((eq (car ret) 'feature)
                 (www-display-feature-desc
                  (decode-uri-string (cdr ret) 'utf-8-mcs-er)
-                  (cdr (assq 'char target))
+                 (cdr (assq 'char target))
                  lang
                  (eq mode 'simple))
+                )
+               (t
+                (www-display-object-desc
+                 (car ret)
+                  (cdr ret)
+                 lang nil
+                 (eq mode 'simple))
                 ))
          ))
        (princ "\n<hr>\n")