From 410ce490ea51709d28173a4fe35d5f3339604a91 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Thu, 18 Mar 2010 15:09:28 +0900 Subject: [PATCH] (www-uri-decode-char): - Accept `:' again. - Prefer `=>jis-x0208' and `=>jis-x0213-1' to `=big5' and `=big5-cdp'. - Fix problem when no CCSes are found. (www-format-feature-name*): New function. (www-format-feature-name): Use `www-format-feature-name*'. --- cwiki-common.el | 56 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/cwiki-common.el b/cwiki-common.el index 8ef14b7..5a8cfda 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -141,7 +141,7 @@ (defun www-uri-decode-char (char-rep) (let (ccs cpos) (cond - ((string-match "%3A" char-rep) + ((string-match "\\(%3A\\|:\\)" char-rep) (setq ccs (substring char-rep 0 (match-beginning 0)) cpos (substring char-rep (match-end 0))) (setq ccs (www-uri-decode-feature-name ccs)) @@ -181,10 +181,10 @@ =zinbun-oracle =daikanwa =gt =gt-k - =big5 - =big5-cdp =>>jis-x0208 =>>jis-x0213-1 - =>jis-x0208 =>jis-x0213-1)) + =>jis-x0208 =>jis-x0213-1 + =big5 + =big5-cdp)) ccs ret) (while (and ccs-list (setq ccs (pop ccs-list)) @@ -193,10 +193,15 @@ (format "%s:0x%X" (www-uri-encode-feature-name ccs) ret)) - ((setq ccs (car (split-char char))) + ((and (setq ccs (car (split-char char))) + (setq ret (encode-char char ccs))) (format "%s:0x%X" (www-uri-encode-feature-name ccs) - (encode-char char ccs))))))) + ret)) + (t + (format "system-char-id:0x%X" + (encode-char char 'system-char-id)) + ))))) ;;; @ Feature name presentation @@ -236,25 +241,28 @@ ) (t dest)))) -(defun www-format-feature-name (feature-name &optional lang) +(defun www-format-feature-name* (feature-name &optional lang) (let (name) - (www-format-encode-string - (cond - ((or (and lang - (char-feature-property - feature-name - (intern (format "name@%s" lang)))) - (char-feature-property - feature-name 'name))) - ((find-charset feature-name) - (www-format-feature-name-as-CCS feature-name)) - ((and (setq name (symbol-name feature-name)) - (string-match "^\\(->\\)" name)) - (www-format-feature-name-as-rel-to feature-name)) - ((string-match "^\\(<-\\)" name) - (www-format-feature-name-as-rel-from feature-name)) - (t - (www-format-feature-name-default feature-name)))))) + (cond + ((or (and lang + (char-feature-property + feature-name + (intern (format "name@%s" lang)))) + (char-feature-property + feature-name 'name))) + ((find-charset feature-name) + (www-format-feature-name-as-CCS feature-name)) + ((and (setq name (symbol-name feature-name)) + (string-match "^\\(->\\)" name)) + (www-format-feature-name-as-rel-to feature-name)) + ((string-match "^\\(<-\\)" name) + (www-format-feature-name-as-rel-from feature-name)) + (t + (www-format-feature-name-default feature-name))))) + +(defun www-format-feature-name (feature-name &optional lang) + (www-format-encode-string + (www-format-feature-name* feature-name lang))) ;;; @ Feature value presentation -- 1.7.10.4