(www-set-display-object-desc): Renamed from
authorMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Thu, 9 Dec 2010 05:33:22 +0000 (14:33 +0900)
committerMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Thu, 9 Dec 2010 05:33:22 +0000 (14:33 +0900)
`www-set-display-char-desc'; add new argument `genre'; rename optional
argument `uri-char' to `uri-object'.
(www-set-display-feature-desc): Rename optional argument `uri-char' to
`uri-object'.
(www-set-display-feature-desc): Likewise.
(www-batch-set): Modify for `www-set-display-object-desc'.

cwiki-set.el

index aee080b..fc56eb7 100644 (file)
 ;;; @ display
 ;;;
 
-(defun www-set-display-char-desc (uri-char feature value format &optional lang)
+(defun www-set-display-object-desc (genre uri-object feature value format
+                                         &optional lang)
   (when (stringp feature)
     (setq feature (intern feature)))
   (when (stringp format)
     (setq format (intern format)))
-  (let ((char (www-uri-decode-object 'character uri-char))
+  (let ((object (www-uri-decode-object 'character uri-object))
        latest-feature
        logical-feature displayed-features
        ret)
-    (when (characterp char)
+    (when (characterp object)
       (princ
        (encode-coding-string
        (format "<head>
 <title>CHISE-wiki character: %s</title>
 </head>\n"
-               (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")
       (www-html-display-paragraph
        (format "char: %S %S %S %S\n"
-              uri-char feature value lang))
+              uri-object feature value lang))
       (setq value (www-feature-parse-string feature value format))
       (www-html-display-paragraph
        (format "char = %c : %S \u2190 %S"
-              char feature value))
+              object feature value))
       (setq latest-feature
            (char-feature-name-at-domain feature '$rev=latest))
       (if value
-         (if (equal (www-get-feature-value char feature) value)
+         (if (equal (www-get-feature-value object feature) value)
              (www-html-display-paragraph
               "Feature-value is not changed.")
             ;; (www-html-display-paragraph
             ;;  (format "New feature-value = %S is different from old value %S"
             ;;          value
-            ;;          (www-get-feature-value char feature)))
-           (put-char-attribute char latest-feature value)
+            ;;          (www-get-feature-value object feature)))
+           (put-char-attribute object latest-feature value)
            (save-char-attribute-table latest-feature)
            (setq ret (char-feature-property '$object 'additional-features))
            (unless (memq feature ret)
         "New feature-value is nil, so it is ignored (may be syntax error).")
        )
       (princ (format "<h1>%s</h1>\n"
-                    (www-format-encode-string (char-to-string char))))
+                    (www-format-encode-string (char-to-string object))))
       (dolist (feature (char-feature-property '$object 'additional-features))
        (mount-char-attribute-table
         (char-feature-name-at-domain feature '$rev=latest)))
-      (dolist (cell (sort (char-attribute-alist char)
+      (dolist (cell (sort (char-attribute-alist object)
                          (lambda (a b)
                            (char-attribute-name< (car a)(car b)))))
        (setq logical-feature
           (www-format-eval-list
            (or (char-feature-property logical-feature 'format)
                '((name) " : " (value)))
-           char logical-feature lang uri-char))
+           object logical-feature lang uri-object))
          (princ
           (format " <a href=\"%s?char=%s&feature=%s&format=wiki-text\"
 ><input type=\"submit\" value=\"note\" /></a>"
                   chise-wiki-edit-url
-                  (www-format-encode-string uri-char)
+                  (www-format-encode-string uri-object)
                   (www-format-encode-string
                    (www-uri-encode-feature-name
                     (intern (format "%s*note" logical-feature))))))
        (format "<p><a href=\"%s?char=%s\"
 ><input type=\"submit\" value=\"add feature\" /></a></p>"
               chise-wiki-add-url
-              (www-format-encode-string uri-char)))
+              (www-format-encode-string uri-object)))
       )))
 
 (defun www-set-display-feature-desc (feature-name property-name value format
-                                                 &optional lang uri-char)
+                                                 &optional lang uri-object)
   (www-html-display-paragraph
    (format
-    "set: feature: %S, property-name: %S, format: %S, value: %S, lang: %S, char: %S\n"
-    feature-name property-name format value lang uri-char))
+    "set: feature: %S, property-name: %S, format: %S, value: %S, lang: %S, object: %S\n"
+    feature-name property-name format value lang uri-object))
   (setq value (www-feature-parse-string property-name value format))
   (www-html-display-paragraph
    (format
-    "set: feature: %S, property-name: %S, format: %S, value: %S, lang: %S, char: %S\n"
-    feature-name property-name format value lang uri-char))
+    "set: feature: %S, property-name: %S, format: %S, value: %S, lang: %S, object: %S\n"
+    feature-name property-name format value lang uri-object))
   (put-char-feature-property feature-name property-name value)
   (let ((name@lang (intern (format "name@%s" lang)))
        (uri-feature-name (www-uri-encode-feature-name feature-name)))
 ><input type=\"submit\" value=\"edit\" /></a></p>"
       chise-wiki-edit-url
       uri-feature-name
-      uri-char))
+      uri-object))
     (www-html-display-paragraph
      (format "description : %s"
              (or (char-feature-property feature-name 'description)
     (princ "<hr />")
     (www-html-display-paragraph
      (format "「[[%c|%s?char=%s]]」に\u623Bる"
-            (www-uri-decode-object 'character uri-char)
+            (www-uri-decode-object 'character uri-object)
             chise-wiki-view-url
-            uri-char))
+            uri-object))
     ))
 
 (defun www-batch-set ()
        (setq ret (car target))
        (cond ((eq (car ret) 'char)
               (setq prop (nth 2 target))
-              (www-set-display-char-desc
+              (www-set-display-object-desc
+               'character
                (cdr ret) ; (decode-uri-string (cdr ret) 'utf-8-mcs-er)
                (intern (decode-uri-string
                         (cdr (assq 'feature-name target))
                lang
                 (cdr (assq 'char target))
                )
+              )
+             (t
+              (setq prop (nth 3 target))
+              (www-set-display-object-desc
+               (car ret)
+               (cdr ret) ; (decode-uri-string (cdr ret) 'utf-8-mcs-er)
+               (intern (decode-uri-string
+                        (cdr (assq 'feature-name target))
+                        'utf-8-mcs-er))
+                (cdr prop) ; (decode-uri-string (cdr prop) 'utf-8-mcs-er)
+               (car prop)
+                lang)
               ))
        (www-html-display-paragraph
         (format "%S" target))