diff options
| author | Kenichi Handa | 2005-05-11 12:29:25 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2005-05-11 12:29:25 +0000 |
| commit | 3921ea2136f06aeadf4fc2f07dd6088a83e1107d (patch) | |
| tree | bf64c3181775b0c8850fc39fcb5f19d7951dc897 | |
| parent | 12045f7460378604cf7672ac815d418af717f718 (diff) | |
| download | emacs-3921ea2136f06aeadf4fc2f07dd6088a83e1107d.tar.gz emacs-3921ea2136f06aeadf4fc2f07dd6088a83e1107d.zip | |
(unidata-text-file): Delete it.
(unidata-list): Initialize to nil.
(unidata-setup-list): New function.
(unidata-gen-files): New optional arg unidata-text-file. If it's
nil, set unidata-text-file the left command line arg. Call
unidate-setup-list at first.
| -rw-r--r-- | admin/unidata/unidata-gen.el | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el index 018db0189b4..f08ddc68b27 100644 --- a/admin/unidata/unidata-gen.el +++ b/admin/unidata/unidata-gen.el | |||
| @@ -74,16 +74,14 @@ | |||
| 74 | ;; 4th: function to call to get a description of a property value | 74 | ;; 4th: function to call to get a description of a property value |
| 75 | ;; 5th: data referred by the above functions | 75 | ;; 5th: data referred by the above functions |
| 76 | 76 | ||
| 77 | ;; The name of the file UnicodeData.txt. | ||
| 78 | (defconst unidata-text-file | ||
| 79 | (expand-file-name "admin/unidata/unidata.txt" source-directory)) | ||
| 80 | |||
| 81 | ;; List of elements of this form: | 77 | ;; List of elements of this form: |
| 82 | ;; (CHAR-or-RANGE PROP1 PROP2 ... PROPn) | 78 | ;; (CHAR-or-RANGE PROP1 PROP2 ... PROPn) |
| 83 | ;; CHAR-or-RANGE: a character code or a cons of character codes | 79 | ;; CHAR-or-RANGE: a character code or a cons of character codes |
| 84 | ;; PROPn: string representing the nth property value | 80 | ;; PROPn: string representing the nth property value |
| 85 | 81 | ||
| 86 | (defvar unidata-list | 82 | (defvar unidata-list nil) |
| 83 | |||
| 84 | (defun unidata-setup-list (unidata-text-file) | ||
| 87 | (let* ((table (list nil)) | 85 | (let* ((table (list nil)) |
| 88 | (tail table) | 86 | (tail table) |
| 89 | (block-names '(("^<CJK Ideograph" . CJK\ IDEOGRAPH) | 87 | (block-names '(("^<CJK Ideograph" . CJK\ IDEOGRAPH) |
| @@ -128,7 +126,7 @@ | |||
| 128 | (setcdr tail (list val)) | 126 | (setcdr tail (list val)) |
| 129 | (setq tail (cdr tail)))) | 127 | (setq tail (cdr tail)))) |
| 130 | (error nil))) | 128 | (error nil))) |
| 131 | (cdr table))) | 129 | (setq unidata-list (cdr table)))) |
| 132 | 130 | ||
| 133 | ;; Alist of this form: | 131 | ;; Alist of this form: |
| 134 | ;; (PROP INDEX GENERATOR FILENAME) | 132 | ;; (PROP INDEX GENERATOR FILENAME) |
| @@ -1121,8 +1119,11 @@ Property value is a character." | |||
| 1121 | ;; The entry function. It generates files described in the header | 1119 | ;; The entry function. It generates files described in the header |
| 1122 | ;; comment of this file. | 1120 | ;; comment of this file. |
| 1123 | 1121 | ||
| 1124 | (defun unidata-gen-files () | 1122 | (defun unidata-gen-files (&optional unidata-text-file) |
| 1125 | (interactive) | 1123 | (or unidata-text-file |
| 1124 | (setq unidata-text-file (car command-line-args-left) | ||
| 1125 | command-line-args-left (cdr command-line-args-left))) | ||
| 1126 | (unidata-setup-list unidata-text-file) | ||
| 1126 | (let ((coding-system-for-write 'utf-8) | 1127 | (let ((coding-system-for-write 'utf-8) |
| 1127 | (charprop-file "charprop.el")) | 1128 | (charprop-file "charprop.el")) |
| 1128 | (with-temp-file charprop-file | 1129 | (with-temp-file charprop-file |