From: MORIOKA Tomohiko Date: Sun, 28 Mar 2010 20:10:22 +0000 (+0900) Subject: (www-parse-string-default): New implementation. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c89586c51f72bbb321f33fa7254cedc622daf7c5;p=chise%2Fest.git (www-parse-string-default): New implementation. (www-set-display-feature-desc): - New argument `format'. - Display `value-format'. (www-batch-set): Modify for the API change to set feature's property. --- diff --git a/cwiki-set.el b/cwiki-set.el index 1337b15..77cc431 100644 --- a/cwiki-set.el +++ b/cwiki-set.el @@ -78,11 +78,23 @@ (defun www-parse-string-default (string) (setq string (decode-uri-string string 'utf-8-mcs-er)) (condition-case nil - (let ((ret - (mapcar #'read (split-string string " ")))) - (if (cdr ret) - ret - (car ret))) + ;; (let ((ret + ;; (mapcar #'read (split-string string " ")))) + ;; (if (cdr ret) + ;; ret + ;; (car ret))) + (let ((i 0) + (len (length string)) + dest ret) + (while (< i len) + (setq ret (read-from-string string i)) + (setq dest (cons (car ret) dest) + i (cdr ret))) + (if (cdr dest) + (nreverse dest) + (if (atom (car dest)) + (car dest) + (nreverse dest)))) (error nil))) (defun www-parse-string-as-space-separated-char-list (string) @@ -231,12 +243,17 @@ (www-format-encode-string uri-char))) ))) -(defun www-set-display-feature-desc (feature-name property-name value +(defun www-set-display-feature-desc (feature-name property-name value format &optional lang uri-char) (www-html-display-paragraph (format - "set: feature: %S, property-name: %S, value: %S, lang: %S, char: %S\n" - feature-name property-name value lang uri-char)) + "set: feature: %S, property-name: %S, format: %S, value: %S, lang: %S, char: %S\n" + feature-name property-name format value lang uri-char)) + (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)) (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))) @@ -278,6 +295,20 @@ (or (www-feature-type feature-name) ;; (char-feature-property feature-name 'type) 'generic))) + (princ (format "

value-format : %s " + (www-format-value + nil 'value-format + (or (www-feature-value-format feature-name) + 'default) + 'default + 'without-tags))) + (princ + (format + "

" + chise-wiki-edit-url + uri-feature-name + uri-char)) (www-html-display-paragraph (format "description : %s" (or (char-feature-property feature-name 'description) @@ -341,14 +372,16 @@ lang) ) ((eq (car ret) 'feature) - (setq prop (nth 2 target)) + (setq prop (nth 3 target)) (www-set-display-feature-desc (intern (decode-uri-string (cdr ret) 'utf-8-mcs-er)) + (intern (decode-uri-string + (cdr (assq 'feature-name (cdr target))) + 'utf-8-mcs-er)) + (cdr prop) ; (decode-uri-string (cdr prop) 'utf-8-mcs-er) (car prop) - (decode-uri-string (cdr prop) 'utf-8-mcs-er) lang (cdr (assq 'char target)) - ;; (decode-uri-string (cdr (assq 'char target))) ) )) (www-html-display-paragraph