From: tomo Date: Mon, 2 May 2005 08:18:20 +0000 (+0000) Subject: (www-batch-ids-find): Changed from top level. X-Git-Tag: chise-core-0_22~38 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=9de3780e947f3a3c0290598c595ae5007cacda1d;p=chise%2Fids.git (www-batch-ids-find): Changed from top level. --- diff --git a/www/www-ids-find.el b/www/www-ids-find.el index 6241253..288bbca 100644 --- a/www/www-ids-find.el +++ b/www/www-ids-find.el @@ -15,22 +15,23 @@ (concat dest (substring string i)) coding-system)))) -(let ((components (car command-line-args-left)) - is ucs) - (setq command-line-args-left (cdr command-line-args-left)) - (cond - ((stringp components) - (if (string-match "^components=" components) - (setq components (substring components (match-end 0)))) - (setq components - (if (> (length components) 0) - (decode-url-string components 'utf-8-jp-er) - nil)) - ) - (t - (setq components nil) - )) - (princ "Content-Type: text/html; charset=\"UTF-8\" +(defun www-batch-ids-find () + (let ((components (car command-line-args-left)) + is ucs) + (setq command-line-args-left (cdr command-line-args-left)) + (cond + ((stringp components) + (if (string-match "^components=" components) + (setq components (substring components (match-end 0)))) + (setq components + (if (> (length components) 0) + (decode-url-string components 'utf-8-jp-er) + nil)) + ) + (t + (setq components nil) + )) + (princ "Content-Type: text/html; charset=\"UTF-8\" @@ -42,79 +43,79 @@

") - (princ (encode-coding-string "CHISE IDS 漢字検索" 'utf-8-jp-er)) - (princ "

+ (princ (encode-coding-string "CHISE IDS 漢字検索" 'utf-8-jp-er)) + (princ "

") - (princ (encode-coding-string "部品文字列" 'utf-8-jp-er)) - (princ " (length components) 0) - (princ (encode-coding-string components 'utf-8-er))) - (princ "\"> + (princ (encode-coding-string "部品文字列" 'utf-8-jp-er)) + (princ " (length components) 0) + (princ (encode-coding-string components 'utf-8-er))) + (princ "\"> + (princ (encode-coding-string "検索開始" 'utf-8-jp-er)) + (princ "\">
") - (when components - ;; (map-char-attribute - ;; (lambda (c v) - ;; (when (every (lambda (p) - ;; (ideographic-structure-member p v)) - ;; components) - ;; (princ (encode-coding-string - ;; (ids-find-format-line c v) - ;; 'utf-8-jp-er)) - ;; (princ "
\n") - ;; ) - ;; nil) - ;; 'ideographic-structure) - (dolist (c (ideographic-products-find components)) - (setq is (char-feature c 'ideographic-structure)) - ;; to avoid problems caused by wrong indexes - (when (every (lambda (c) - (ideographic-structure-member c is)) - components) - (princ - (encode-coding-string - (format "%c" c) - 'utf-8-jp-er)) - (princ - (or (if (setq ucs (or (char-ucs c) - (encode-char c 'ucs))) - (format "%s" - ucs - (cond ((<= ucs #xFFFF) - (format " U+%04X" ucs)) - ((<= ucs #x10FFFF) - (format "U-%08X" ucs)))) - " "))) - (princ " ") - (princ - (encode-coding-string - (ideographic-structure-to-ids is) - 'utf-8-jp-er)) - (when (and ucs - (with-current-buffer - (find-file-noselect - "~tomo/projects/chise/ids/www/tang-chars.udd") - (goto-char (point-min)) - (re-search-forward (format "^%d$" ucs) nil t))) + (when components + ;; (map-char-attribute + ;; (lambda (c v) + ;; (when (every (lambda (p) + ;; (ideographic-structure-member p v)) + ;; components) + ;; (princ (encode-coding-string + ;; (ids-find-format-line c v) + ;; 'utf-8-jp-er)) + ;; (princ "
\n") + ;; ) + ;; nil) + ;; 'ideographic-structure) + (dolist (c (ideographic-products-find components)) + (setq is (char-feature c 'ideographic-structure)) + ;; to avoid problems caused by wrong indexes + (when (every (lambda (c) + (ideographic-structure-member c is)) + components) (princ - (format " " - (mapconcat - (lambda (c) - (format "%%%02X" (char-int c))) - (encode-coding-string (char-to-string c) - 'utf-8-jp) - ""))) - (princ (encode-coding-string "⇒[唐代拓本]" 'utf-8-jp-er))) - (princ "
\n") - )) - ) - (princ " + (encode-coding-string + (format "%c" c) + 'utf-8-jp-er)) + (princ + (or (if (setq ucs (or (char-ucs c) + (encode-char c 'ucs))) + (format "%s" + ucs + (cond ((<= ucs #xFFFF) + (format " U+%04X" ucs)) + ((<= ucs #x10FFFF) + (format "U-%08X" ucs)))) + " "))) + (princ " ") + (princ + (encode-coding-string + (ideographic-structure-to-ids is) + 'utf-8-jp-er)) + (when (and ucs + (with-current-buffer + (find-file-noselect + "~tomo/projects/chise/ids/www/tang-chars.udd") + (goto-char (point-min)) + (re-search-forward (format "^%d$" ucs) nil t))) + (princ + (format " " + (mapconcat + (lambda (c) + (format "%%%02X" (char-int c))) + (encode-coding-string (char-to-string c) + 'utf-8-jp) + ""))) + (princ (encode-coding-string "⇒[唐代拓本]" 'utf-8-jp-er))) + (princ "
\n") + )) + ) + (princ " -")) +")))