X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ids-read.el;h=ecc92ff986626c6ef9d0bd900efc0efa312b84ae;hb=61187907c30d7c3d8f1ef13a932f3548b55636ae;hp=f759d14bad17986a3991e6a833ab010bfc064f08;hpb=14e7cb73cf809a040e4223bb4ece4325d047cc1b;p=chise%2Fids.git diff --git a/ids-read.el b/ids-read.el index f759d14..ecc92ff 100644 --- a/ids-read.el +++ b/ids-read.el @@ -1,6 +1,6 @@ ;;; ids-read.el --- Reader for IDS-* files -;; Copyright (C) 2002 MORIOKA Tomohiko +;; Copyright (C) 2002,2003 MORIOKA Tomohiko ;; Author: MORIOKA Tomohiko ;; Keywords: IDS, IDC, Ideographs, UCS, Unicode @@ -27,7 +27,7 @@ (require 'ids) ;;;###autoload -(defun ids-read-buffer (buffer &optional simplify) +(defun ids-read-buffer (buffer &optional simplify soft) (interactive "bBuffer = \nP") (save-excursion (set-buffer buffer) @@ -50,6 +50,17 @@ chs) (decode-char 'japanese-jisx0208-1990 (string-to-int (match-string 1 chs) 16))) + ((string-match "CDP-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" + chs) + (decode-char '=big5-cdp + (string-to-int (match-string 1 chs) 16))) + ((string-match + "HZK\\([0-9][0-9]\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" + chs) + (decode-char (intern + (format "=hanziku-%d" + (string-to-int (match-string 1)))) + (string-to-int (match-string 2 chs) 16))) ((string-match "M-\\([0-9]+\\)'" chs) (setq code (string-to-int (match-string 1 chs))) (map-char-attribute @@ -85,6 +96,9 @@ (string-to-int (match-string 1 chs)))) )) (when (and char + (or (not soft) + (null + (get-char-attribute char 'ideographic-structure))) (>= (length ids) 3) (not (string-match "\\?" ids)) (consp (setq structure (ids-parse-string ids simplify)))) @@ -96,11 +110,11 @@ )))) ;;;###autoload -(defun ids-read-file (file &optional simplify) +(defun ids-read-file (file &optional simplify soft) (interactive "fIDS file = \nP") (with-temp-buffer (insert-file-contents file) - (ids-read-buffer (current-buffer) simplify))) + (ids-read-buffer (current-buffer) simplify soft))) ;;; @ End.