From: MORIOKA Tomohiko Date: Sat, 4 Dec 2010 18:11:04 +0000 (+0900) Subject: (www-edit-display-object-desc): Renamed from X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a54ed69623f7bd78fc6e741e86b6748d7737832b;p=chise%2Fest.git (www-edit-display-object-desc): Renamed from `www-edit-display-char-desc'; add new argument `genre'. (www-batch-edit): Modify for `www-edit-display-object-desc'. --- diff --git a/cwiki-edit.el b/cwiki-edit.el index eb22d27..b526cfb 100644 --- a/cwiki-edit.el +++ b/cwiki-edit.el @@ -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 " CHISE-wiki character: %s \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 "\n") (princ (format "

%s

\n" - (www-format-encode-string (char-to-string char)))) + (www-format-encode-string (char-to-string object)))) (princ "
\n") (princ (encode-coding-string (format "

(char : )

" - (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 "

") @@ -111,12 +111,12 @@ size=\"30\" maxlength=\"30\" value=\"%s\">)

(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 "

\n") (when (and (eq base-name (car cell)) metadata-name) (princ "")) )) @@ -126,7 +126,7 @@ size=\"30\" maxlength=\"30\" value=\"%s\">)

(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\">\n" (format "

(に限\u5B9Aしない) " - (decode-uri-string uri-char 'utf-8-mcs-er)) + (decode-uri-string uri-object 'utf-8-mcs-er)) 'utf-8-mcs-er)) (princ "

") (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))