From 9f5da5ed588e4334efe257bd79cbaf6394c8f338 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Fri, 10 Dec 2010 20:14:35 +0900 Subject: [PATCH] (www-edit-display-feature-input-box): Moved to cwiki-view.el. (www-edit-display-object-desc): New implementation; use `www-display-object-desc'. --- cwiki-edit.el | 231 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 122 insertions(+), 109 deletions(-) diff --git a/cwiki-edit.el b/cwiki-edit.el index a8d81a0..4e273c4 100644 --- a/cwiki-edit.el +++ b/cwiki-edit.el @@ -2,7 +2,8 @@ (defvar chise-wiki-view-url "view.cgi") (defvar chise-wiki-edit-url "edit.cgi") -(require 'cwiki-format) +;; (require 'cwiki-format) +(require 'cwiki-view) ;; (defun www-edit-display-input-box (object name value &optional format) ;; (when (stringp format) @@ -30,117 +31,129 @@ ;; 'without-tags) ;; )))) -(defun www-edit-display-feature-input-box (char feature-name - &optional format value) - (unless format - (setq format 'default)) - (unless value - (setq value (www-get-feature-value char feature-name))) - (princ - (format "

" - feature-name)) - (princ (encode-coding-string " \u2190 " 'utf-8-mcs-er)) - (princ - (format "%s -

-" - (if (or (eq format 'HEX)(eq format 'hex)) - "0x" - "") - format - (mapconcat (lambda (c) - (cond - ;; ((eq c ?<) "&lt;") - ;; ((eq c ?>) "&gt;") - ((eq c ?\u0022) """) - (t - (char-to-string c)))) - (www-format-value char feature-name - value format 'without-tags) - ""))) - ) +;; (defun www-edit-display-feature-input-box (char feature-name +;; &optional format value) +;; (unless format +;; (setq format 'default)) +;; (unless value +;; (setq value (www-get-feature-value char feature-name))) +;; (princ +;; (format "

" +;; feature-name)) +;; (princ (encode-coding-string " \u2190 " 'utf-8-mcs-er)) +;; (princ +;; (format "%s +;;

+;; " +;; (if (or (eq format 'HEX)(eq format 'hex)) +;; "0x" +;; "") +;; format +;; (mapconcat (lambda (c) +;; (cond +;; ;; ((eq c ?<) "&lt;") +;; ;; ((eq c ?>) "&gt;") +;; ((eq c ?\u0022) """) +;; (t +;; (char-to-string c)))) +;; (est-format-unit +;; (est-eval-unit +;; (if (symbolp format) +;; (list format) +;; format) +;; char feature-name) +;; 'without-tags) +;; ;; (www-format-value char feature-name +;; ;; value format 'without-tags) +;; ""))) +;; ) (defun www-edit-display-object-desc (genre uri-object uri-feature-name &optional lang format) - (when (stringp format) - (setq format (intern format))) - (let ((object (www-uri-decode-object genre uri-object)) - (feature-name (www-uri-decode-feature-name uri-feature-name)) - base-name metadata-name - parents - object-spec str) - (when object - (princ - (encode-coding-string - (format " -EsT %s = %s -\n" - genre - (decode-uri-string uri-object 'utf-8-mcs-er)) - 'utf-8-mcs-er)) - (princ "\n") - (when (eq genre 'character) - (dolist (feature (char-feature-property '$object 'additional-features)) - (mount-char-attribute-table - (char-feature-name-at-domain feature '$rev=latest)))) - (when (setq parents (www-get-feature-value object '<-denotational)) - (princ (format "

%s %s

\n
\n" - (www-format-value-as-char-list parents) - (www-format-feature-name '->denotational lang)))) - (when (setq parents (www-get-feature-value object '<-subsumptive)) - (princ (format "

%s %s

\n
\n" - (www-format-value-as-char-list parents) - (www-format-feature-name '->subsumptive lang)))) - (princ - (format "

%s

\n" - (www-format-encode-string (est-format-object object)))) - (princ "
\n") - (princ - (encode-coding-string - (format "

(%s : )

-" - genre genre - (decode-uri-string uri-object 'utf-8-mcs-er)) - 'utf-8-mcs-er)) - (setq object-spec - (if (eq genre 'character) - (char-attribute-alist object) - (concord-object-spec 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 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 object feature-name format) - ) - (t - (princ "

") - (princ - (www-format-eval-list - (or (char-feature-property (car cell) 'format) - '((name) " : " (value))) - object (car cell) lang uri-object)) - (princ "

\n") - (when (and (eq base-name (car cell)) metadata-name) - (princ "")) - )) - ) - (princ "
\n") - ))) + (www-display-object-desc genre uri-object lang 1 nil + uri-feature-name format)) + +;; (defun www-edit-display-object-desc (genre uri-object uri-feature-name +;; &optional lang format) +;; (when (stringp format) +;; (setq format (intern format))) +;; (let ((object (www-uri-decode-object genre uri-object)) +;; (feature-name (www-uri-decode-feature-name uri-feature-name)) +;; base-name metadata-name +;; parents +;; object-spec str) +;; (when object +;; (princ +;; (encode-coding-string +;; (format " +;; EsT %s = %s +;; \n" +;; genre +;; (decode-uri-string uri-object 'utf-8-mcs-er)) +;; 'utf-8-mcs-er)) +;; (princ "\n") +;; (when (eq genre 'character) +;; (dolist (feature (char-feature-property '$object 'additional-features)) +;; (mount-char-attribute-table +;; (char-feature-name-at-domain feature '$rev=latest)))) +;; (when (setq parents (www-get-feature-value object '<-denotational)) +;; (princ (format "

%s %s

\n
\n" +;; (www-format-value-as-char-list parents) +;; (www-format-feature-name '->denotational lang)))) +;; (when (setq parents (www-get-feature-value object '<-subsumptive)) +;; (princ (format "

%s %s

\n
\n" +;; (www-format-value-as-char-list parents) +;; (www-format-feature-name '->subsumptive lang)))) +;; (princ +;; (format "

%s

\n" +;; (www-format-encode-string (est-format-object object)))) +;; (princ "
\n") +;; (princ +;; (encode-coding-string +;; (format "

(%s : )

+;; " +;; genre genre +;; (decode-uri-string uri-object 'utf-8-mcs-er)) +;; 'utf-8-mcs-er)) +;; (setq object-spec +;; (if (eq genre 'character) +;; (char-attribute-alist object) +;; (concord-object-spec 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 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 object feature-name format) +;; ) +;; (t +;; (princ "

") +;; (princ +;; (www-format-eval-list +;; (or (char-feature-property (car cell) 'format) +;; '((name) " : " (value))) +;; object (car cell) lang uri-object)) +;; (princ "

\n") +;; (when (and (eq base-name (car cell)) metadata-name) +;; (princ "")) +;; )) +;; ) +;; (princ "
\n") +;; ))) (defun www-edit-display-feature-desc (uri-feature-name uri-property-name -- 1.7.10.4