From: tomo Date: Thu, 20 Jun 2002 17:01:00 +0000 (+0000) Subject: (ids-read-buffer): Add new optional argument `simplify'; if `simplify' X-Git-Tag: ids-0_0-1~275 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3c5749cb25a1e539029ec5728a7672fdabd89b09;p=chise%2Fids.git (ids-read-buffer): Add new optional argument `simplify'; if `simplify' is nil, don't simplify a subtree; accept CB-nnnnn. (ids-read-file): Likewise. --- diff --git a/ids-read.el b/ids-read.el index 7b7d8d0..646f3c3 100644 --- a/ids-read.el +++ b/ids-read.el @@ -27,8 +27,8 @@ (require 'ids) ;;;###autoload -(defun ids-read-buffer (buffer) - (interactive "bBuffer = ") +(defun ids-read-buffer (buffer &optional simplify) + (interactive "bBuffer = \nP") (save-excursion (set-buffer buffer) (goto-char (point-min)) @@ -49,11 +49,14 @@ ((string-match "M-\\([0-9]+\\)" chs) (decode-char 'ideograph-daikanwa (string-to-int (match-string 1 chs)))) + ((string-match "CB-\\([0-9]+\\)" chs) + (decode-char 'ideograph-cbeta + (string-to-int (match-string 1 chs)))) )) (when (and char (>= (length ids) 3) (not (string-match "\\?" ids)) - (consp (setq structure (ids-parse-string ids)))) + (consp (setq structure (ids-parse-string ids simplify)))) (put-char-attribute char 'ideographic-structure (cdr (car structure)))) @@ -62,11 +65,11 @@ )))) ;;;###autoload -(defun ids-read-file (file) - (interactive "fIDS file = ") +(defun ids-read-file (file &optional simplify) + (interactive "fIDS file = \nP") (with-temp-buffer (insert-file-contents file) - (ids-read-buffer (current-buffer)))) + (ids-read-buffer (current-buffer) simplify))) ;;; @ End.