From: MORIOKA Tomohiko Date: Mon, 30 Nov 2015 10:12:03 +0000 (+0900) Subject: Require `cwiki-common' of EsT. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=755c2764f29b773076b7ab1483f58cac3fe06c30;p=chise%2Fids.git Require `cwiki-common' of EsT. (www-ids-find-version): Update to 0.26. (www-ids-find-char-viewer-url): Use "/est/view/character/" instead of "/chisewiki/view.cgi?char=". (www-ids-find-format-char): New implementation; use `www-uri-encode-object' and `www-format-encode-string'. --- diff --git a/www/www-ids-find.el b/www/www-ids-find.el index 45ee759..51b372c 100644 --- a/www/www-ids-find.el +++ b/www/www-ids-find.el @@ -1,4 +1,5 @@ (require 'ids-find) +(require 'cwiki-common) (defun decode-url-string (string &optional coding-system) (if (> (length string) 0) @@ -15,7 +16,7 @@ (concat dest (substring string i)) coding-system)))) -(defconst www-ids-find-version "0.25.1") +(defconst www-ids-find-version "0.26") (defvar www-ids-find-ideographic-products-file-name (expand-file-name "ideographic-products" @@ -26,7 +27,7 @@ chise-system-db-directory)))) (defvar www-ids-find-char-viewer-url - "/chisewiki/view.cgi?char=") + "/est/view/character/") (defvar www-ids-find-chise-link-map-url-prefix "http://fonts.jp/chise_linkmap/map.cgi?code=") @@ -35,96 +36,102 @@ "~tomo/projects/chise/ids/www/tang-chars.udd") (defun www-ids-find-format-char (c &optional code-desc) - (let ((str (encode-coding-string (format "%c" c) 'utf-8-er)) - plane code) - (princ - (with-temp-buffer - (cond - ((string-match "&CB\\([0-9]+\\);" str) - (setq code (string-to-int (match-string 1 str))) - (insert (format "\"CB%05d\"\n" - code (/ code 1000) code)) - (when code-desc - (insert (format "CB%05d" code))) - ) - ((string-match "&JC3-\\([0-9A-F]+\\);" str) - (setq code (string-to-int (match-string 1 str) 16)) - (insert (format "\"JC3-%04X\"\n" - code code)) - (when code-desc - (insert (format "JC3-%04X" code))) - ) - ((string-match "&J\\(78\\|83\\|90\\|SP\\)-\\([0-9A-F]+\\);" str) - (setq plane (match-string 1 str) - code (string-to-int (match-string 2 str) 16)) - (insert (format "\"J%s-%04X\"\n" - plane code plane - (- (lsh code -8) 32) - (- (logand code 255) 32))) - (when code-desc - (insert (format "J%s-%04X" plane code))) - ) - ((string-match "&G\\([01]\\)-\\([0-9A-F]+\\);" str) - (setq plane (string-to-int (match-string 1 str)) - code (string-to-int (match-string 2 str) 16)) - (insert (format "\"G%d-%04X\"\n" - plane code plane - (- (lsh code -8) 32) - (- (logand code 255) 32))) - (when code-desc - (insert (format "G%d-%04X" plane code))) - ) - ((string-match "&C\\([1-7]\\)-\\([0-9A-F]+\\);" str) - (setq plane (string-to-int (match-string 1 str)) - code (string-to-int (match-string 2 str) 16)) - (insert (format "\"C%d-%04X\"\n" - plane code plane code)) - (when code-desc - (insert (format "C%d-%04X" plane code))) - ) - ((string-match "&ZOB-\\([0-9]+\\);" str) - (setq code (string-to-int (match-string 1 str))) - (insert (format "\"ZOB-%04d\"\n" - code code)) - (when code-desc - (insert (format "ZOB-%04d" code))) - ) - (t - (insert (format "") - (insert str) - (insert "") - )) - (goto-char (point-min)) - (while (search-forward "&" nil t) - (replace-match "&" t 'literal)) - (buffer-string))))) + (princ + (format "%s" + www-ids-find-char-viewer-url + (www-uri-encode-object c) + (www-format-encode-string (char-to-string c)))) + ;; (let ((str (encode-coding-string (format "%c" c) 'utf-8-er)) + ;; plane code) + ;; (princ + ;; (with-temp-buffer + ;; (cond + ;; ((string-match "&CB\\([0-9]+\\);" str) + ;; (setq code (string-to-int (match-string 1 str))) + ;; (insert (format "\"CB%05d\"\n" + ;; code (/ code 1000) code)) + ;; (when code-desc + ;; (insert (format "CB%05d" code))) + ;; ) + ;; ((string-match "&JC3-\\([0-9A-F]+\\);" str) + ;; (setq code (string-to-int (match-string 1 str) 16)) + ;; (insert (format "\"JC3-%04X\"\n" + ;; code code)) + ;; (when code-desc + ;; (insert (format "JC3-%04X" code))) + ;; ) + ;; ((string-match "&J\\(78\\|83\\|90\\|SP\\)-\\([0-9A-F]+\\);" str) + ;; (setq plane (match-string 1 str) + ;; code (string-to-int (match-string 2 str) 16)) + ;; (insert (format "\"J%s-%04X\"\n" + ;; plane code plane + ;; (- (lsh code -8) 32) + ;; (- (logand code 255) 32))) + ;; (when code-desc + ;; (insert (format "J%s-%04X" plane code))) + ;; ) + ;; ((string-match "&G\\([01]\\)-\\([0-9A-F]+\\);" str) + ;; (setq plane (string-to-int (match-string 1 str)) + ;; code (string-to-int (match-string 2 str) 16)) + ;; (insert (format "\"G%d-%04X\"\n" + ;; plane code plane + ;; (- (lsh code -8) 32) + ;; (- (logand code 255) 32))) + ;; (when code-desc + ;; (insert (format "G%d-%04X" plane code))) + ;; ) + ;; ((string-match "&C\\([1-7]\\)-\\([0-9A-F]+\\);" str) + ;; (setq plane (string-to-int (match-string 1 str)) + ;; code (string-to-int (match-string 2 str) 16)) + ;; (insert (format "\"C%d-%04X\"\n" + ;; plane code plane code)) + ;; (when code-desc + ;; (insert (format "C%d-%04X" plane code))) + ;; ) + ;; ((string-match "&ZOB-\\([0-9]+\\);" str) + ;; (setq code (string-to-int (match-string 1 str))) + ;; (insert (format "\"ZOB-%04d\"\n" + ;; code code)) + ;; (when code-desc + ;; (insert (format "ZOB-%04d" code))) + ;; ) + ;; (t + ;; (insert (format "") + ;; (insert str) + ;; (insert "") + ;; )) + ;; (goto-char (point-min)) + ;; (while (search-forward "&" nil t) + ;; (replace-match "&" t 'literal)) + ;; (buffer-string)))) + ) (defun www-ids-find-format-line (c is) (let (ucs len i ids) @@ -388,7 +395,7 @@ href=\"http://www.shuiren.org/\">睡人亭)による解説 )) (princ "
") (princ "

-Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 MORIOKA Tomohiko") (princ (format