diff options
| author | Glenn Morris | 2017-04-24 22:17:27 -0700 |
|---|---|---|
| committer | Glenn Morris | 2017-04-24 23:06:27 -0700 |
| commit | c1e71d3899daca49e216dfa3a6e6e07169d02e1e (patch) | |
| tree | 36c432a4a3bb4298877385c2a21b9ba9d3bc8309 /admin | |
| parent | 735ae5cd3a76735c1b51913eaeff5df5f0b2b53e (diff) | |
| download | emacs-c1e71d3899daca49e216dfa3a6e6e07169d02e1e.tar.gz emacs-c1e71d3899daca49e216dfa3a6e6e07169d02e1e.zip | |
Further refactoring in unidata-gen.el
* admin/unidata/unidata-gen.el (unidata-gen-charprop):
New function, split from unidata-gen-files.
(unidata-gen-files): Use unidata-gen-charprop.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/unidata/unidata-gen.el | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el index fd398f74065..5f3cd1c8d3e 100644 --- a/admin/unidata/unidata-gen.el +++ b/admin/unidata/unidata-gen.el | |||
| @@ -1434,6 +1434,25 @@ Property value is a symbol `o' (Open), `c' (Close), or `n' (None)." | |||
| 1434 | (format ";; %s ends here\n" basename))))) | 1434 | (format ";; %s ends here\n" basename))))) |
| 1435 | (or noninteractive (message "Generating %s...done" file))) | 1435 | (or noninteractive (message "Generating %s...done" file))) |
| 1436 | 1436 | ||
| 1437 | (defun unidata-gen-charprop (&optional charprop-file) | ||
| 1438 | (or charprop-file (setq charprop-file (pop command-line-args-left))) | ||
| 1439 | (with-temp-file charprop-file | ||
| 1440 | (insert ";; Automatically generated by unidata-gen.el.\n") | ||
| 1441 | (dolist (elt unidata-file-alist) | ||
| 1442 | (dolist (proplist (cdr elt)) | ||
| 1443 | (insert (format "(define-char-code-property '%S %S\n %S)\n" | ||
| 1444 | (unidata-prop-prop proplist) (car elt) | ||
| 1445 | (unidata-prop-docstring proplist))))) | ||
| 1446 | (message "Writing %s..." charprop-file) | ||
| 1447 | (insert ";; Local Variables:\n" | ||
| 1448 | ";; coding: utf-8\n" | ||
| 1449 | ";; version-control: never\n" | ||
| 1450 | ";; no-byte-compile: t\n" | ||
| 1451 | ";; no-update-autoloads: t\n" | ||
| 1452 | ";; End:\n\n" | ||
| 1453 | (format ";; %s ends here\n" | ||
| 1454 | (file-name-nondirectory charprop-file))))) | ||
| 1455 | |||
| 1437 | ;; The entry function. It generates files described in the header | 1456 | ;; The entry function. It generates files described in the header |
| 1438 | ;; comment of this file. | 1457 | ;; comment of this file. |
| 1439 | 1458 | ||
| @@ -1448,30 +1467,12 @@ Property value is a symbol `o' (Open), `c' (Close), or `n' (None)." | |||
| 1448 | (expand-file-name "unidata.txt")))) | 1467 | (expand-file-name "unidata.txt")))) |
| 1449 | (let ((coding-system-for-write 'utf-8-unix) | 1468 | (let ((coding-system-for-write 'utf-8-unix) |
| 1450 | (coding-system-for-read 'utf-8) | 1469 | (coding-system-for-read 'utf-8) |
| 1451 | (charprop-file (expand-file-name "charprop.el" dest-dir)) | ||
| 1452 | (unidata-dir data-dir)) | 1470 | (unidata-dir data-dir)) |
| 1453 | (unidata-setup-list unidata-text-file) | 1471 | (unidata-setup-list unidata-text-file) |
| 1454 | (with-temp-file charprop-file | 1472 | (dolist (elt unidata-file-alist) |
| 1455 | (insert ";; Automatically generated by unidata-gen.el.\n") | 1473 | (unidata-gen-file (expand-file-name (car elt) dest-dir) |
| 1456 | (dolist (elt unidata-file-alist) | 1474 | data-dir unidata-text-file)) |
| 1457 | (let* ((file (expand-file-name (car elt) dest-dir)) | 1475 | (unidata-gen-charprop (expand-file-name "charprop.el" dest-dir)))) |
| 1458 | (basename (file-name-nondirectory file))) | ||
| 1459 | (unidata-gen-file file data-dir unidata-text-file) | ||
| 1460 | ;; Filename in this comment line is extracted by sed in Makefile. | ||
| 1461 | (insert (format ";; FILE: %s\n" basename)) | ||
| 1462 | (dolist (proplist (cdr elt)) | ||
| 1463 | (insert (format "(define-char-code-property '%S %S\n %S)\n" | ||
| 1464 | (unidata-prop-prop proplist) basename | ||
| 1465 | (unidata-prop-docstring proplist)))))) | ||
| 1466 | (message "Writing %s..." charprop-file) | ||
| 1467 | (insert ";; Local Variables:\n" | ||
| 1468 | ";; coding: utf-8\n" | ||
| 1469 | ";; version-control: never\n" | ||
| 1470 | ";; no-byte-compile: t\n" | ||
| 1471 | ";; no-update-autoloads: t\n" | ||
| 1472 | ";; End:\n\n" | ||
| 1473 | (format ";; %s ends here\n" | ||
| 1474 | (file-name-nondirectory charprop-file)))))) | ||
| 1475 | 1476 | ||
| 1476 | 1477 | ||
| 1477 | 1478 | ||