From: MORIOKA Tomohiko Date: Sun, 22 Jan 2023 13:30:44 +0000 (+0900) Subject: (www-ids-find-version): Update to 0.100.1. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5c81e4555968b87c7784198762f2d6efd5457d5;p=chise%2Fids.git (www-ids-find-version): Update to 0.100.1. (www-ids-find-format-char): Add " ()" if optional argument `code-desc' is specified. (www-ids-find-format-ids): New function. (www-ids-find-format-line): Use `www-ids-find-format-ids' to display " ()" follow after IDS images. (www-batch-ids-find): Update Copyright. --- diff --git a/www/www-ids-find.el b/www/www-ids-find.el index e397773..c6af0a8 100644 --- a/www/www-ids-find.el +++ b/www/www-ids-find.el @@ -561,7 +561,7 @@ style=\"vertical-align:middle\">" (concat dest (substring string i)) coding-system)))) -(defconst www-ids-find-version "0.100") +(defconst www-ids-find-version "0.100.1") (defvar www-ids-find-ideographic-products-file-name (expand-file-name "ideographic-products" @@ -587,15 +587,50 @@ style=\"vertical-align:middle\">" www-ids-find-char-viewer-url (www-uri-encode-object c) (if ucs - (format "\"u%04x\"" + (format "\"u%04x\"%s" ucs chise-wiki-glyphwiki-glyph-image-url - ucs) + ucs + (if code-desc + (encode-coding-string (format " (%c)" c) 'utf-8-mcs-er) + "")) (www-format-encode-string (char-to-string c))))) )) +(defun www-ids-find-format-ids (ids &optional code-desc) + (let (len i ucs ret) + (setq i 0 + len (length ids)) + (while (< i len) + (www-ids-find-format-char (aref ids i)) + (setq i (1+ i))) + (when code-desc + (princ + (format " (%s)" + (mapconcat + (lambda (c) + (setq ucs (or (char-ucs c) + (encode-char c '=>ucs@iso) + (encode-char c '=>ucs@unicode) + (encode-char c '=>ucs@iwds-1) + (encode-char c '=>ucs@iwds-1/normalized) + (encode-char c '=>ucs@component) + (encode-char c '=>ucs@cognate))) + (cond (ucs + (encode-coding-string + (char-to-string (decode-char '=ucs ucs)) + 'utf-8-mcs-er) + ) + (t + (setq ret (encode-coding-string + (char-to-string c) 'utf-8-mcs-er)) + (if (eq (aref ret 0) ?&) + (concat "&" (substring ret 1))) + ))) + ids "")))))) + (defun www-ids-find-format-line (c is) - (let (ucs len i ids) + (let (ucs ids) (princ "") (www-ids-find-format-char c 'code-desc) (princ "") @@ -615,14 +650,16 @@ style=\"vertical-align:middle\">" (format " (link map)" www-ids-find-chise-link-map-url-prefix ucs))) (princ " ") + ;; (www-ids-find-format-ideographic-structure is 'code-desc) (when is (setq ids (ideographic-structure-to-ids is)) - (setq i 0 - len (length ids)) + ;; (setq i 0 + ;; len (length ids)) (princ "") - (while (< i len) - (www-ids-find-format-char (aref ids i)) - (setq i (1+ i))) + (www-ids-find-format-ids ids 'code-desc) + ;; (while (< i len) + ;; (www-ids-find-format-char (aref ids i)) + ;; (setq i (1+ i))) (princ "")) (when (and ucs (with-current-buffer @@ -947,7 +984,7 @@ href=\"http://www.shuiren.org/\">睡人亭)による解説
") (princ "
-Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2015, 2016, 2017, 2020, 2021, 2022 MORIOKA Tomohiko
") (princ (format