emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114857: * admin/unidata/unidata-gen.el (unidata--en


From: Glenn Morris
Subject: [Emacs-diffs] trunk r114857: * admin/unidata/unidata-gen.el (unidata--ensure-compiled): New function.
Date: Wed, 30 Oct 2013 06:25:58 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114857
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Tue 2013-10-29 23:25:44 -0700
message:
  * 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.
modified:
  admin/ChangeLog                changelog-20091113204419-o5vbwnq5f7feedwu-2226
  admin/unidata/unidata-gen.el   
unidatagen.el-20091113204419-o5vbwnq5f7feedwu-8382
=== modified file 'admin/ChangeLog'
--- a/admin/ChangeLog   2013-10-30 06:24:16 +0000
+++ b/admin/ChangeLog   2013-10-30 06:25:44 +0000
@@ -1,5 +1,9 @@
 2013-10-30  Glenn Morris  <address@hidden>
 
+       * 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.

=== modified file 'admin/unidata/unidata-gen.el'
--- a/admin/unidata/unidata-gen.el      2012-02-16 13:55:03 +0000
+++ b/admin/unidata/unidata-gen.el      2013-10-30 06:25:44 +0000
@@ -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 @@
                      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 @@
 (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 @@
 
 (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 @@
            (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]