From 01f31a359a834d5ad91f1c5bf0a1b442ccbfc2c3 Mon Sep 17 00:00:00 2001 From: tomo Date: Wed, 17 Apr 2002 08:57:41 +0000 Subject: [PATCH] (iddef-check-mapping-buffer): Add `hanyu-dazidian' and remove `hanyu-dazidian-{vol|page|char}'. --- iddef.el | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/iddef.el b/iddef.el index 0593729..11dbe58 100644 --- a/iddef.el +++ b/iddef.el @@ -98,12 +98,13 @@ (defun iddef-check-mapping-buffer (buffer) (with-current-buffer buffer (goto-char (point-min)) - (let (ucs radical plane code ccs chr ret) - (while (re-search-forward "^U\\+\\([0-9A-F]+\\)\t\\([0-9]+\\)\t[^\t]*\t[^\t]*\t[^\t]*\t\\([0-9A-C]\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" nil t) + (let (ucs radical hyd plane code ccs chr ret hyd-v hyd-p hyd-c) + (while (re-search-forward "^U\\+\\([0-9A-F]+\\)\t\\([0-9]+\\)\t[^\t]*\t[^\t]*\t\\([^\t]*\\)\t\\([0-9A-C]\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" nil t) (setq ucs (string-to-int (match-string 1) 16) radical (string-to-int (match-string 2)) - plane (string-to-int (match-string 3) 16) - code (string-to-int (match-string 4) 16)) + hyd (match-string 3) + plane (string-to-int (match-string 4) 16) + code (string-to-int (match-string 5) 16)) (setq ccs (if (= plane 0) (progn @@ -124,6 +125,18 @@ (setq chr (define-char (list (cons 'ucs ucs) (cons ccs code))))) ) + (when (and hyd + (string-match "^\\([1-9]\\)\\([0-9][0-9][0-9][0-9]\\)\\.\\([0-9][0-9]\\)0$" + hyd)) + (setq hyd-v (string-to-int (match-string 1 hyd)) + hyd-p (string-to-int (match-string 2 hyd)) + hyd-c (string-to-int (match-string 3 hyd))) + (put-char-attribute chr 'hanyu-dazidian + (list hyd-v hyd-p hyd-c)) + (remove-char-attribute chr 'hanyu-dazidian-vol) + (remove-char-attribute chr 'hanyu-dazidian-page) + (remove-char-attribute chr 'hanyu-dazidian-char) + ) (unless (get-char-attribute chr 'ideographic-radical) (put-char-attribute chr 'ideographic-radical radical)) ))))) -- 1.7.10.4