]> git.eshelyaron.com Git - emacs.git/commitdiff
* admin/unidata/unidata-gen.el (unidata--ensure-compiled): New function.
authorGlenn Morris <rgm@gnu.org>
Wed, 30 Oct 2013 06:25:44 +0000 (23:25 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 30 Oct 2013 06:25:44 +0000 (23:25 -0700)
(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.

admin/ChangeLog
admin/unidata/unidata-gen.el

index c3b12658b889addaf5088fe720a030d495e4d2e0..bbbd652f1beddf921f65a1478b7d7b8c0dbaf118 100644 (file)
@@ -1,5 +1,9 @@
 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.
index d9277217f0e30688b98c96c411b3f1d856c15d2c..05dde225d91a3a03108922733d283737855feb14 100644 (file)
@@ -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)