I'm frequently downloading new versions of the JDE, (since my quota
requires that I store it in /tmp :) using a shell script, and liked the
addition of jde-compile-jde. One thing it lacks is compiling of the
associated packages (eieio, elib, semantic, & speedbar). I've modified
jde-compile-jde slightly, and added jde-compile-jde-depends to recompile
both the jde and the packages it depends on.

This is the first time I've posted any emacs-hacking of my own, so
comments and criticisms are welcome :)  Note that the function assumes
that these packages (and jde/lisp) are on your load path already, with the
version names reomoved.

--- jde.el.orig Fri Dec 22 00:17:16 2000
+++ jde.el      Thu Jan 11 00:02:47 2001
@@ -1420,41 +1420,45 @@
   (interactive)
   (jde-describe-map 'jde-mode-map))
 
-
-;; Contributed by John Ciolfi, [EMAIL PROTECTED]
-(defun jde-compile-file-if-necessary (file)
-  "Compile the JDE file FILE if necessary.
-This is done if FILE.el is newer than FILE.elc or if FILE.elc doesn't exist."
-  (if (string= (file-name-extension file) "el")
-      (let* ((root (file-name-sans-extension file))
-            (elc-file (concat root ".elc")))
-       (if (or (not (file-exists-p elc-file))
-               (file-newer-than-file-p file  elc-file))
-           (progn
-             (message (format "Byte-compiling %s..." 
-                              (file-name-nondirectory file)))
-             (byte-compile-file file))))))
-
 ;;;###autoload
 (defun jde-compile-jde ()
   "Byte-compile all uncompiled files of jde."
 
   ;; Be sure to have . in load-path since a number of files in jde
   ;; depend on other files and we always want the newer one even if
-  ;; a previous version of jde exists.
+  ;; a previous version of jde exists (for jde developers).
+
+  (interactive)
+  (let ((load-path (append '(".") load-path)))
+    (byte-recompile-directory 
+     (expand-file-name "lisp" (jde-find-jde-data-directory)) 0)))
+
+;;;###autoload
+(defun jde-compile-jde-depends ()
+  "Byte-compile all uncompiled files of the entire jde. 
+Usefull when a new version has just been installed and
+can be called from the command line via:
+
+   \"emacs -f jde-compile-jde-depends\"
 
+assuming a directory structure similar to the following, 
+with package lisp directories in your path:
+      site
+        jde
+        speedbar
+        semantic
+        elib
+        eieio"
   (interactive)
-  (let ((load-path (append '(".") load-path))
-       (buffer-directory (file-name-directory (buffer-file-name)))
-       (jde-lisp-directory (expand-file-name "lisp" (jde-find-jde-data-directory))))
-    (save-excursion 
-      (dired jde-lisp-directory)
-      (mapcar 
-       (function jde-compile-file-if-necessary)
-       (mapcar 
-       (lambda (file)
-         (expand-file-name file jde-lisp-directory))
-       (directory-files jde-lisp-directory))))))
+    (mapcar
+     (lambda (directory)
+       (byte-recompile-directory 
+        (expand-file-name directory (jde-find-jde-data-directory)) 0))
+     (list "lisp"
+           "../speedbar"
+           "../semantic"
+           "../elib"
+           "../eieio")))
 
 (provide 'jde) 

--
Chad McHenry
<[EMAIL PROTECTED]>



Reply via email to