From: tomo Date: Fri, 16 Jan 2004 18:15:29 +0000 (+0000) Subject: (jp-jouyou-read-file): New function. X-Git-Tag: r21-4-14-chise-0_21-19^2~86 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b1f8909906a28f9f25a475600c3199416024fd8;p=chise%2Fxemacs-chise.git.1 (jp-jouyou-read-file): New function. --- diff --git a/lisp/utf-2000/read-maps.el b/lisp/utf-2000/read-maps.el index e01835d..a764315 100644 --- a/lisp/utf-2000/read-maps.el +++ b/lisp/utf-2000/read-maps.el @@ -1,6 +1,6 @@ ;;; read-maps.el --- Read mapping-tables. -;; Copyright (C) 2002,2003 MORIOKA Tomohiko +;; Copyright (C) 2002,2003,2004 MORIOKA Tomohiko ;; Author: MORIOKA Tomohiko ;; Keywords: mapping table, character, CCS, multiscript, multilingual @@ -145,6 +145,34 @@ (put-char-attribute chr ucs-ccs ucs))))) (forward-line))))) +(defun jp-jouyou-read-file (filename) + (interactive "fjp-jouyou file : ") + (with-temp-buffer + (buffer-disable-undo) + (insert-file-contents filename) + (goto-char (point-min)) + (let (char tchars) + (while (re-search-forward "^[^\t\n ]+\t\\(.\\)\t*" nil t) + (setq char (aref (match-string 1) 0) + tchars (buffer-substring (match-end 0) + (point-at-eol))) + (when (> (length tchars) 0) + (setq tchars + (mapcar (lambda (c) + (aref c 0)) + (split-string tchars " "))) + (put-char-attribute char + '<-simplified@JP/Jouyou + tchars)) + ;; (put-char-attribute + ;; char 'script (adjoin + ;; 'JP + ;; (adjoin + ;; 'Jouyou + ;; (adjoin + ;; 'Ideograph + ;; (get-char-attribute char 'script))))) + )))) (provide 'read-maps)