diff options
| author | Glenn Morris | 2014-09-07 23:00:58 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-09-07 23:00:58 -0700 |
| commit | c04714f7c87956eb49e803d69290793f15fdaa90 (patch) | |
| tree | bf673719000a4e8d20178433870c1759d1759020 /admin | |
| parent | 4612d1eab721a1010312382d1048c8b3a67b18fa (diff) | |
| parent | 6e82d877a4a59feb4390baeb2ccc57e7cd03593d (diff) | |
| download | emacs-c04714f7c87956eb49e803d69290793f15fdaa90.tar.gz emacs-c04714f7c87956eb49e803d69290793f15fdaa90.zip | |
Merge from emacs-24; up to 2014-07-08T06:24:07Z!eggert@cs.ucla.edu
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/ChangeLog | 8 | ||||
| -rw-r--r-- | admin/unidata/unidata-gen.el | 39 |
2 files changed, 38 insertions, 9 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index bbb673beddf..4ebf97d3163 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-09-08 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * unidata/unidata-gen.el (unidata-check): Bring this function up | ||
| 4 | to date with the currently supported methods of generating Unicode | ||
| 5 | property tables. Add a comment with a description how to invoke | ||
| 6 | the check. Update the copyright years in the reference to the | ||
| 7 | Unicode data files we use. | ||
| 8 | |||
| 1 | 2014-08-30 Paul Eggert <eggert@cs.ucla.edu> | 9 | 2014-08-30 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 10 | ||
| 3 | Vector-sorting fixes (Bug#18361). | 11 | Vector-sorting fixes (Bug#18361). |
diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el index ff45b79aab7..fb9b6dccc72 100644 --- a/admin/unidata/unidata-gen.el +++ b/admin/unidata/unidata-gen.el | |||
| @@ -854,7 +854,7 @@ is the character itself."))) | |||
| 854 | ;; The following command yields a file of about 96K bytes. | 854 | ;; The following command yields a file of about 96K bytes. |
| 855 | ;; % gawk -F ';' '{print $1,$2;}' < UnicodeData.txt | gzip > temp.gz | 855 | ;; % gawk -F ';' '{print $1,$2;}' < UnicodeData.txt | gzip > temp.gz |
| 856 | ;; With the following function, we can get a file of almost the same | 856 | ;; With the following function, we can get a file of almost the same |
| 857 | ;; the size. | 857 | ;; size. |
| 858 | 858 | ||
| 859 | ;; Generate a char-table for character names. | 859 | ;; Generate a char-table for character names. |
| 860 | 860 | ||
| @@ -1174,25 +1174,42 @@ is the character itself."))) | |||
| 1174 | 1174 | ||
| 1175 | ;; Verify if we can retrieve correct values from the generated | 1175 | ;; Verify if we can retrieve correct values from the generated |
| 1176 | ;; char-tables. | 1176 | ;; char-tables. |
| 1177 | ;; | ||
| 1178 | ;; Use like this: | ||
| 1179 | ;; | ||
| 1180 | ;; (let ((unidata-dir "/path/to/admin/unidata")) | ||
| 1181 | ;; (unidata-setup-list "unidata.txt") | ||
| 1182 | ;; (unidata-check)) | ||
| 1177 | 1183 | ||
| 1178 | (defun unidata-check () | 1184 | (defun unidata-check () |
| 1179 | (dolist (elt unidata-prop-alist) | 1185 | (dolist (elt unidata-prop-alist) |
| 1180 | (let* ((prop (car elt)) | 1186 | (let* ((prop (car elt)) |
| 1181 | (index (unidata-prop-index prop)) | 1187 | (index (unidata-prop-index prop)) |
| 1182 | (generator (unidata-prop-generator prop)) | 1188 | (generator (unidata-prop-generator prop)) |
| 1189 | (default-value (unidata-prop-default prop)) | ||
| 1190 | (val-list (unidata-prop-val-list prop)) | ||
| 1183 | (table (progn | 1191 | (table (progn |
| 1184 | (message "Generating %S table..." prop) | 1192 | (message "Generating %S table..." prop) |
| 1185 | (funcall generator prop))) | 1193 | (funcall generator prop default-value val-list))) |
| 1186 | (decoder (char-table-extra-slot table 1)) | 1194 | (decoder (char-table-extra-slot table 1)) |
| 1195 | (alist (and (functionp index) | ||
| 1196 | (funcall index))) | ||
| 1187 | (check #x400)) | 1197 | (check #x400)) |
| 1188 | (dolist (e unidata-list) | 1198 | (dolist (e unidata-list) |
| 1189 | (let ((char (car e)) | 1199 | (let* ((char (car e)) |
| 1190 | (val1 (nth index e)) | 1200 | (val1 |
| 1191 | val2) | 1201 | (if alist (nth 1 (assoc char alist)) |
| 1202 | (nth index e))) | ||
| 1203 | val2) | ||
| 1192 | (if (and (stringp val1) (= (length val1) 0)) | 1204 | (if (and (stringp val1) (= (length val1) 0)) |
| 1193 | (setq val1 nil)) | 1205 | (setq val1 nil)) |
| 1194 | (unless (consp char) | 1206 | (unless (or (consp char) |
| 1195 | (setq val2 (funcall decoder char (aref table char) table)) | 1207 | (integerp decoder)) |
| 1208 | (setq val2 | ||
| 1209 | (cond ((functionp decoder) | ||
| 1210 | (funcall decoder char (aref table char) table)) | ||
| 1211 | (t ; must be nil | ||
| 1212 | (aref table char)))) | ||
| 1196 | (if val1 | 1213 | (if val1 |
| 1197 | (cond ((eq generator 'unidata-gen-table-symbol) | 1214 | (cond ((eq generator 'unidata-gen-table-symbol) |
| 1198 | (setq val1 (intern val1))) | 1215 | (setq val1 (intern val1))) |
| @@ -1201,11 +1218,15 @@ is the character itself."))) | |||
| 1201 | ((eq generator 'unidata-gen-table-character) | 1218 | ((eq generator 'unidata-gen-table-character) |
| 1202 | (setq val1 (string-to-number val1 16))) | 1219 | (setq val1 (string-to-number val1 16))) |
| 1203 | ((eq generator 'unidata-gen-table-decomposition) | 1220 | ((eq generator 'unidata-gen-table-decomposition) |
| 1204 | (setq val1 (unidata-split-decomposition val1))))) | 1221 | (setq val1 (unidata-split-decomposition val1)))) |
| 1222 | (cond ((eq prop 'decomposition) | ||
| 1223 | (setq val1 (list char))))) | ||
| 1205 | (when (>= char check) | 1224 | (when (>= char check) |
| 1206 | (message "%S %04X" prop check) | 1225 | (message "%S %04X" prop check) |
| 1207 | (setq check (+ check #x400))) | 1226 | (setq check (+ check #x400))) |
| 1208 | (or (equal val1 val2) | 1227 | (or (equal val1 val2) |
| 1228 | ;; <control> characters get a 'name' property of nil | ||
| 1229 | (and (eq prop 'name) (string= val1 "<control>") (null val2)) | ||
| 1209 | (insert (format "> %04X %S\n< %04X %S\n" | 1230 | (insert (format "> %04X %S\n< %04X %S\n" |
| 1210 | char val1 char val2))) | 1231 | char val1 char val2))) |
| 1211 | (sit-for 0))))))) | 1232 | (sit-for 0))))))) |
| @@ -1261,7 +1282,7 @@ is the character itself."))) | |||
| 1261 | (setq describer (symbol-function describer))) | 1282 | (setq describer (symbol-function describer))) |
| 1262 | (set-char-table-extra-slot table 3 describer)) | 1283 | (set-char-table-extra-slot table 3 describer)) |
| 1263 | (if (bobp) | 1284 | (if (bobp) |
| 1264 | (insert ";; Copyright (C) 1991-2013 Unicode, Inc. | 1285 | (insert ";; Copyright (C) 1991-2014 Unicode, Inc. |
| 1265 | ;; This file was generated from the Unicode data files at | 1286 | ;; This file was generated from the Unicode data files at |
| 1266 | ;; http://www.unicode.org/Public/UNIDATA/. | 1287 | ;; http://www.unicode.org/Public/UNIDATA/. |
| 1267 | ;; See lisp/international/README for the copyright and permission notice.\n")) | 1288 | ;; See lisp/international/README for the copyright and permission notice.\n")) |