summaryrefslogtreecommitdiff
path: root/admin/unidata/unidata-gen.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-10-29 23:25:44 -0700
committerGlenn Morris <rgm@gnu.org>2013-10-29 23:25:44 -0700
commit0d0ab9326bd8759170356b475c0672446822783d (patch)
tree8c1a5f6275ec0d93b816ffbb4160351489fe67cf /admin/unidata/unidata-gen.el
parent447892edb676cf79035d4084a1befa72a56b7e38 (diff)
downloademacs-0d0ab9326bd8759170356b475c0672446822783d.tar.gz
* admin/unidata/unidata-gen.el (unidata--ensure-compiled): New function.
(unidata-gen-table-name, unidata-gen-table-decomposition) (unidata-gen-files): Use unidata--ensure-compiled. Add FSF copyright years based on when this file first appeared in Emacs trunk.
Diffstat (limited to 'admin/unidata/unidata-gen.el')
-rw-r--r--admin/unidata/unidata-gen.el26
1 files changed, 15 insertions, 11 deletions
diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el
index d9277217f0e..05dde225d91 100644
--- a/admin/unidata/unidata-gen.el
+++ b/admin/unidata/unidata-gen.el
@@ -1,4 +1,7 @@
;; unidata-gen.el -- Create files containing character property data.
+
+;; Copyright 2008-2013 (C) Free Software Foundation, Inc.
+
;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H13PRO009
@@ -23,8 +26,7 @@
;; SPECIAL NOTICE
;;
;; This file must be byte-compilable/loadable by `temacs' and also
-;; the entry function `unidata-gen-files' must be runnable by
-;; `temacs'.
+;; the entry function `unidata-gen-files' must be runnable by `temacs'.
;; FILES TO BE GENERATED
;;
@@ -975,11 +977,15 @@ is the character itself.")))
idx (1+ i)))))
(nreverse (cons (intern (substring str idx)) l))))))
+(defun unidata--ensure-compiled (&rest funcs)
+ (dolist (fun funcs)
+ (or (byte-code-function-p (symbol-function fun))
+ (byte-compile fun))))
+
(defun unidata-gen-table-name (prop &rest ignore)
(let* ((table (unidata-gen-table-word-list prop 'unidata-split-name))
(word-tables (char-table-extra-slot table 4)))
- (byte-compile 'unidata-get-name)
- (byte-compile 'unidata-put-name)
+ (unidata--ensure-compiled 'unidata-get-name 'unidata-put-name)
(set-char-table-extra-slot table 1 (symbol-function 'unidata-get-name))
(set-char-table-extra-slot table 2 (symbol-function 'unidata-put-name))
@@ -1017,8 +1023,8 @@ is the character itself.")))
(defun unidata-gen-table-decomposition (prop &rest ignore)
(let* ((table (unidata-gen-table-word-list prop 'unidata-split-decomposition))
(word-tables (char-table-extra-slot table 4)))
- (byte-compile 'unidata-get-decomposition)
- (byte-compile 'unidata-put-decomposition)
+ (unidata--ensure-compiled 'unidata-get-decomposition
+ 'unidata-put-decomposition)
(set-char-table-extra-slot table 1
(symbol-function 'unidata-get-decomposition))
(set-char-table-extra-slot table 2
@@ -1178,10 +1184,8 @@ is the character itself.")))
(defun unidata-gen-files (&optional data-dir unidata-text-file)
(or data-dir
- (setq data-dir (car command-line-args-left)
- command-line-args-left (cdr command-line-args-left)
- unidata-text-file (car command-line-args-left)
- command-line-args-left (cdr command-line-args-left)))
+ (setq data-dir (pop command-line-args-left)
+ unidata-text-file (pop command-line-args-left)))
(let ((coding-system-for-write 'utf-8-unix)
(charprop-file "charprop.el")
(unidata-dir data-dir))
@@ -1216,7 +1220,7 @@ is the character itself.")))
(setq table (funcall generator prop default-value val-list))
(when describer
(unless (subrp (symbol-function describer))
- (byte-compile describer)
+ (unidata--ensure-compiled describer)
(setq describer (symbol-function describer)))
(set-char-table-extra-slot table 3 describer))
(if (bobp)