emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/emacs-lisp autoload.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp/emacs-lisp autoload.el
Date: Thu, 15 Oct 2009 06:09:52 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       09/10/15 06:09:52

Modified files:
        lisp/emacs-lisp: autoload.el 

Log message:
        (autoload-make-program): New variable.
        (batch-update-autoloads): Handle autoload-excludes on windows-nt.
        
        See discussion:
        http://lists.gnu.org/archive/html/emacs-devel/2009-10/msg00243.html

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/emacs-lisp/autoload.el?cvsroot=emacs&r1=1.149&r2=1.150

Patches:
Index: autoload.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/autoload.el,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -b -r1.149 -r1.150
--- autoload.el 7 Oct 2009 16:10:37 -0000       1.149
+++ autoload.el 15 Oct 2009 06:09:52 -0000      1.150
@@ -679,6 +679,9 @@
 (define-obsolete-function-alias 'update-autoloads-from-directories
     'update-directory-autoloads "22.1")
 
+(defvar autoload-make-program (or (getenv "MAKE") "make")
+  "Name of the make program in use during the Emacs build process.")
+
 ;;;###autoload
 (defun batch-update-autoloads ()
   "Update loaddefs.el autoloads in batch mode.
@@ -686,9 +689,40 @@
   ;; For use during the Emacs build process only.
   (unless autoload-excludes
     (let* ((ldir (file-name-directory generated-autoload-file))
-          (mfile (expand-file-name "../src/Makefile" ldir))
+          (default-directory
+            (file-name-as-directory
+             (expand-file-name (if (eq system-type 'windows-nt)
+                                   "../lib-src"
+                                 "../src") ldir)))
+          (mfile "Makefile")
+          (tmpfile "echolisp.tmp")
           lim)
+      ;; Windows uses the 'echolisp' approach because:
+      ;; i) It does not have $lisp as a single simple definition, so
+      ;; it would be harder to parse the Makefile.
+      ;; ii) It can, since it already has $lisp broken up into pieces
+      ;; that the command-line can handle.
+      ;; Non-Windows builds do not use the 'echolisp' approach because
+      ;; no-one knows (?) the maximum safe command-line length on all
+      ;; supported systems.  $lisp is much longer there since it uses
+      ;; absolute paths, and it would seem a shame to split it just for this.
       (when (file-readable-p mfile)
+       (if (eq system-type 'windows-nt)
+           (when (ignore-errors
+                  (if (file-exists-p tmpfile) (delete-file tmpfile))
+                  ;; FIXME call-process is better, if it works.
+                  (shell-command (format "%s echolisp > %s"
+                                         autoload-make-program tmpfile))
+                  (file-readable-p tmpfile))
+             (with-temp-buffer
+               (insert-file-contents tmpfile)
+               ;; FIXME could be a single while loop.
+               (while (not (eobp))
+                 (setq lim (line-end-position))
+                 (while (re-search-forward "\\([^ ]+\\.el\\)c?\\>" lim t)
+                   (push (expand-file-name (match-string 1))
+                         autoload-excludes))
+                 (forward-line 1))))
        (with-temp-buffer
          (insert-file-contents mfile)
          (when (re-search-forward "^lisp= " nil t)
@@ -696,7 +730,7 @@
            (while (re-search-forward "\\${lispsource}\\([^ ]+\\.el\\)c?\\>"
                                      lim t)
              (push (expand-file-name (match-string 1) ldir)
-                   autoload-excludes)))))))
+                     autoload-excludes))))))))
   (let ((args command-line-args-left))
     (setq command-line-args-left nil)
     (apply 'update-directory-autoloads args)))




reply via email to

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