From: tomo Date: Fri, 26 May 2000 08:45:40 +0000 (+0000) Subject: (insert-char-data): Change order for `script'. X-Git-Tag: r21-2-33-utf-2000-0_15-1~3 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f8220d306f70b347cb46adf6a7cbe7f3dfc8146d;p=chise%2Fxemacs-chise.git.1 (insert-char-data): Change order for `script'. (insert-char-data-with-variant): Add optional argument `script'. (insert-char-range-data): Likewise. (write-char-range-data-to-file): Likewise. --- diff --git a/lisp/utf-2000/char-db-util.el b/lisp/utf-2000/char-db-util.el index c9ebf1a..3b3a4ba 100644 --- a/lisp/utf-2000/char-db-util.el +++ b/lisp/utf-2000/char-db-util.el @@ -133,16 +133,12 @@ cell)) (setq data (del-alist 'name data)) ) - (when (setq cell (assq 'name data)) - (setq cell (cdr cell)) - (insert (format - (if (> (length cell) 47) - "(name . %S) + (when (setq cell (assq 'script data)) + (insert (format "(script\t\t%s) " - "(name\t\t. %S) - ") - cell)) - (setq data (del-alist 'name data)) + (mapconcat (function prin1-to-string) + (cdr cell) " "))) + (setq data (del-alist 'script data)) ) (when (setq cell (assq 'ucs data)) (setq cell (cdr cell)) @@ -534,30 +530,35 @@ (insert (format "\t; %c" char))) ))))) -(defun insert-char-data-with-variant (char) +(defun insert-char-data-with-variant (char &optional script) (insert-char-data char) (let ((variants (or (char-variants char) (let ((ucs (get-char-attribute char '->ucs))) (if ucs - (delete char (char-variants (int-char ucs)))))))) + (delete char (char-variants (int-char ucs))))))) + variant vs) (while variants - (insert-char-data (car variants)) + (setq variant (car variants)) + (if (or (null script) + (null (setq vs (get-char-attribute variant 'script))) + (memq script vs)) + (insert-char-data variant)) (setq variants (cdr variants)) ))) -(defun insert-char-range-data (min max) +(defun insert-char-range-data (min max &optional script) (let ((code min) char) (while (<= code max) (setq char (int-char code)) - (insert-char-data-with-variant char) + (insert-char-data-with-variant char script) (setq code (1+ code)) ))) -(defun write-char-range-data-to-file (min max file) +(defun write-char-range-data-to-file (min max file &optional script) (let ((coding-system-for-write 'utf-8)) (with-temp-buffer - (insert-char-range-data min max) + (insert-char-range-data min max script) (write-region (point-min)(point-max) file)))) (defvar what-character-original-window-configuration)