(www-edit-display-object-desc): Renamed from
authorMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Sat, 4 Dec 2010 18:11:04 +0000 (03:11 +0900)
committerMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Sat, 4 Dec 2010 18:11:04 +0000 (03:11 +0900)
`www-edit-display-char-desc'; add new argument `genre'.
(www-batch-edit): Modify for `www-edit-display-object-desc'.

cwiki-edit.el

index eb22d27..b526cfb 100644 (file)
@@ -62,48 +62,48 @@ size=\"64\" maxlength=\"256\" value=\"%s\">
                      "")))
   )
 
-(defun www-edit-display-char-desc (uri-char uri-feature-name
-                                           &optional lang format)
+(defun www-edit-display-object-desc (genre uri-object uri-feature-name
+                                          &optional lang format)
   (when (stringp format)
     (setq format (intern format)))
-  (let ((char (www-uri-decode-object 'character uri-char))
+  (let ((object (www-uri-decode-object genre uri-object))
        (feature-name (www-uri-decode-feature-name uri-feature-name))
        base-name metadata-name
-       char-spec str)
-    (when (characterp char)
+       object-spec str)
+    (when (characterp object)
       (princ
        (format "<head>
 <title>CHISE-wiki character: %s</title>
 </head>\n"
               (encode-coding-string
-               (decode-uri-string uri-char 'utf-8-mcs-er)
+               (decode-uri-string uri-object 'utf-8-mcs-er)
                'utf-8-mcs-er)))
       (princ "<body>\n")
       (princ
        (format "<h1>%s</h1>\n"
-              (www-format-encode-string (char-to-string char))))
+              (www-format-encode-string (char-to-string object))))
       (princ "<form action=\"set.cgi\" method=\"GET\">\n")
       (princ
        (encode-coding-string
        (format "<p>(char : <input type=\"text\" name=\"char\"
 size=\"30\" maxlength=\"30\" value=\"%s\">)</p>
 "
-               (decode-uri-string uri-char 'utf-8-mcs-er))
+               (decode-uri-string uri-object 'utf-8-mcs-er))
        'utf-8-mcs-er))
-      (setq char-spec (char-attribute-alist char))
+      (setq object-spec (char-attribute-alist object))
       (if (string-match "\\*" (setq str (symbol-name feature-name)))
          (setq base-name (intern (substring str 0 (match-beginning 0)))
                metadata-name (intern (substring str (match-end 0))))
        (setq base-name feature-name))
-      (unless (assq base-name char-spec)
-       (setq char-spec (cons (cons base-name nil)
-                             char-spec)))
-      (dolist (cell (sort char-spec
+      (unless (assq base-name object-spec)
+       (setq object-spec (cons (cons base-name nil)
+                             object-spec)))
+      (dolist (cell (sort object-spec
                          (lambda (a b)
                            (char-attribute-name< (car a)(car b)))))
        (cond
         ((eq (car cell) feature-name)
-         (www-edit-display-feature-input-box char feature-name format)
+         (www-edit-display-feature-input-box object feature-name format)
          )
         (t
          (princ "<p>")
@@ -111,12 +111,12 @@ size=\"30\" maxlength=\"30\" value=\"%s\">)</p>
           (www-format-eval-list
            (or (char-feature-property (car cell) 'format)
                '((name) " : " (value)))
-           char (car cell) lang uri-char))
+           object (car cell) lang uri-object))
          (princ "</p>\n")
          (when (and (eq base-name (car cell)) metadata-name)
            (princ "<ul>\n")
            (princ "<li>")
-            (www-edit-display-feature-input-box char feature-name format)
+            (www-edit-display-feature-input-box object feature-name format)
            (princ "</li>")
            (princ "</ul>"))
          ))
@@ -126,7 +126,7 @@ size=\"30\" maxlength=\"30\" value=\"%s\">)</p>
 
 (defun www-edit-display-feature-desc (uri-feature-name
                                      uri-property-name
-                                     &optional lang uri-char)
+                                     &optional lang uri-object)
   (let ((feature-name (www-uri-decode-feature-name uri-feature-name))
        (property-name (www-uri-decode-feature-name uri-property-name))
        name@lang)
@@ -150,7 +150,7 @@ size=\"30\" maxlength=\"30\" value=\"%s\"></h1>\n"
       (format "<p>(<input type=\"text\" name=\"char\"
 size=\"30\" maxlength=\"30\" value=\"%s\">に限\u5B9Aしない)
 "
-             (decode-uri-string uri-char 'utf-8-mcs-er))
+             (decode-uri-string uri-object 'utf-8-mcs-er))
       'utf-8-mcs-er))
     (princ "<p>")
     (if (eq property-name 'name)
@@ -258,7 +258,8 @@ size=\"30\" maxlength=\"30\" value=\"%s\">に限\u5B9Aしない)
                      (split-string target "&")))
        (setq ret (car target))
        (cond ((eq (car ret) 'char)
-              (www-edit-display-char-desc
+              (www-edit-display-object-desc
+               'character
                 (cdr ret) ; (decode-uri-string (cdr ret) 'utf-8-mcs-er)
                (decode-uri-string (cdr (assq 'feature target))
                                   'utf-8-mcs-er)
@@ -276,6 +277,16 @@ size=\"30\" maxlength=\"30\" value=\"%s\">に限\u5B9Aしない)
                 ;; (decode-uri-string (cdr (assq 'char target))
                 ;;                    'utf-8-mcs-er)
                )
+              )
+             (t
+              (www-edit-display-object-desc
+                (car ret)
+               (cdr ret)
+               (decode-uri-string (cdr (assq 'feature target))
+                                  'utf-8-mcs-er)
+               lang
+               (decode-uri-string (cdr (assq 'format target))
+                                  'utf-8-mcs-er))
               ))
        (www-html-display-paragraph
         (format "%S" target))