2013-10-30 Glenn Morris <rgm@gnu.org>
+ * unidata/unidata-gen.el (unidata--ensure-compiled): New function.
+ (unidata-gen-table-name, unidata-gen-table-decomposition)
+ (unidata-gen-files): Use unidata--ensure-compiled.
+
* unidata/Makefile.in (abs_srcdir): New, set by configure.
(${DSTDIR}/charprop.el, charprop.el): Update for srcdir not absolute.
(clean): Delete all .elc files.
;; 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
;; 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
;;
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))
(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
(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))
(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)