diff options
| author | Michal Nazarewicz | 2017-06-19 21:34:25 +0200 |
|---|---|---|
| committer | Michal Nazarewicz | 2017-06-22 15:58:40 +0200 |
| commit | 21132e2623dddd19be421ba326434e3cffb1019b (patch) | |
| tree | ccbac210127cc196c778e1512d5d7cdedfb5fa19 /admin | |
| parent | 0ee2e853abfe2c6ed1f4fd105c0a52fd93b271fb (diff) | |
| download | emacs-21132e2623dddd19be421ba326434e3cffb1019b.tar.gz emacs-21132e2623dddd19be421ba326434e3cffb1019b.zip | |
unidata: don’t check special casing in unidata-check (bug#26656)
* admin/unidata/unidata-gen.el (unidata-check): Do not test special
casing mapping of characters since that mapping is not constructed from
the unidata.txt file.
Also, check for integer decoder and cons char earlier so that less
unnecessary processing is performed.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/unidata/unidata-gen.el | 94 |
1 files changed, 50 insertions, 44 deletions
diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el index e1e896ce29c..478099c831a 100644 --- a/admin/unidata/unidata-gen.el +++ b/admin/unidata/unidata-gen.el | |||
| @@ -1346,50 +1346,56 @@ Property value is a symbol `o' (Open), `c' (Close), or `n' (None)." | |||
| 1346 | (generator (unidata-prop-generator proplist)) | 1346 | (generator (unidata-prop-generator proplist)) |
| 1347 | (default-value (unidata-prop-default proplist)) | 1347 | (default-value (unidata-prop-default proplist)) |
| 1348 | (val-list (unidata-prop-val-list proplist)) | 1348 | (val-list (unidata-prop-val-list proplist)) |
| 1349 | (table (progn | 1349 | (check #x400) |
| 1350 | (message "Generating %S table..." prop) | 1350 | table decoder alist) |
| 1351 | (funcall generator prop index default-value val-list))) | 1351 | ;; We compare values in unidata.txt with the ones returned by various |
| 1352 | (decoder (char-table-extra-slot table 1)) | 1352 | ;; generator functions. However, SpecialCasing.txt is read directly by |
| 1353 | (alist (and (functionp index) | 1353 | ;; unidata-gen-table-special-casing--do-load and there is no other file |
| 1354 | (funcall index))) | 1354 | ;; to compare those values with. This is why we’re skipping the check |
| 1355 | (check #x400)) | 1355 | ;; for special casing properties. |
| 1356 | (dolist (e unidata-list) | 1356 | (unless (eq generator 'unidata-gen-table-special-casing) |
| 1357 | (let* ((char (car e)) | 1357 | (setq table (progn |
| 1358 | (val1 | 1358 | (message "Generating %S table..." prop) |
| 1359 | (if alist (nth 1 (assoc char alist)) | 1359 | (funcall generator prop index default-value val-list)) |
| 1360 | (nth index e))) | 1360 | decoder (char-table-extra-slot table 1)) |
| 1361 | val2) | 1361 | (unless (integerp decoder) |
| 1362 | (if (and (stringp val1) (= (length val1) 0)) | 1362 | (setq alist (and (functionp index) (funcall index))) |
| 1363 | (setq val1 nil)) | 1363 | (dolist (e unidata-list) |
| 1364 | (unless (or (consp char) | 1364 | (let ((char (car e)) val1 val2) |
| 1365 | (integerp decoder)) | 1365 | (unless (consp char) |
| 1366 | (setq val2 | 1366 | (setq val1 (if alist |
| 1367 | (cond ((functionp decoder) | 1367 | (nth 1 (assoc char alist)) |
| 1368 | (funcall decoder char (aref table char) table)) | 1368 | (nth index e))) |
| 1369 | (t ; must be nil | 1369 | (and (stringp val1) |
| 1370 | (aref table char)))) | 1370 | (= (length val1) 0) |
| 1371 | (if val1 | 1371 | (setq val1 nil)) |
| 1372 | (cond ((eq generator 'unidata-gen-table-symbol) | 1372 | (if val1 |
| 1373 | (setq val1 (intern val1))) | 1373 | (cond ((eq generator 'unidata-gen-table-symbol) |
| 1374 | ((eq generator 'unidata-gen-table-integer) | 1374 | (setq val1 (intern val1))) |
| 1375 | (setq val1 (string-to-number val1))) | 1375 | ((eq generator 'unidata-gen-table-integer) |
| 1376 | ((eq generator 'unidata-gen-table-character) | 1376 | (setq val1 (string-to-number val1))) |
| 1377 | (setq val1 (string-to-number val1 16))) | 1377 | ((eq generator 'unidata-gen-table-character) |
| 1378 | ((eq generator 'unidata-gen-table-decomposition) | 1378 | (setq val1 (string-to-number val1 16))) |
| 1379 | (setq val1 (unidata-split-decomposition val1)))) | 1379 | ((eq generator 'unidata-gen-table-decomposition) |
| 1380 | (cond ((eq prop 'decomposition) | 1380 | (setq val1 (unidata-split-decomposition val1)))) |
| 1381 | (setq val1 (list char))) | 1381 | (cond ((eq prop 'decomposition) |
| 1382 | ((eq prop 'bracket-type) | 1382 | (setq val1 (list char))) |
| 1383 | (setq val1 'n)))) | 1383 | ((eq prop 'bracket-type) |
| 1384 | (when (>= char check) | 1384 | (setq val1 'n)))) |
| 1385 | (message "%S %04X" prop check) | 1385 | (setq val2 (aref table char)) |
| 1386 | (setq check (+ check #x400))) | 1386 | (when decoder |
| 1387 | (or (equal val1 val2) | 1387 | (setq val2 (funcall decoder char val2 table))) |
| 1388 | ;; <control> characters get a 'name' property of nil | 1388 | (when (>= char check) |
| 1389 | (and (eq prop 'name) (string= val1 "<control>") (null val2)) | 1389 | (message "%S %04X" prop check) |
| 1390 | (insert (format "> %04X %S\n< %04X %S\n" | 1390 | (setq check (+ check #x400))) |
| 1391 | char val1 char val2))) | 1391 | (or (equal val1 val2) |
| 1392 | (sit-for 0)))))))) | 1392 | ;; <control> characters get a 'name' property of nil |
| 1393 | (and (eq prop 'name) | ||
| 1394 | (string= val1 "<control>") | ||
| 1395 | (null val2)) | ||
| 1396 | (insert (format "> %04X %S\n< %04X %S\n" | ||
| 1397 | char val1 char val2))) | ||
| 1398 | (sit-for 0)))))))))) | ||
| 1393 | 1399 | ||
| 1394 | ;; The entry functions. They generate files described in the header | 1400 | ;; The entry functions. They generate files described in the header |
| 1395 | ;; comment of this file. | 1401 | ;; comment of this file. |