emacs-devel
[Top][All Lists]
Advanced

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

ignoring autoloads in preloaded files on Windows [was Re: Changes in lis


From: Glenn Morris
Subject: ignoring autoloads in preloaded files on Windows [was Re: Changes in lisp/Makefile.in to skip preloaded files]
Date: Fri, 09 Oct 2009 20:50:25 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

>> What I had in mind for working around possible limitations of
>> command-line length was to run "make -C ../src echolisp > FILE" and
>> then read that FILE inside batch-update-autoloads.

Here is an attempt at this. Please could someone test this on Windows.


*** lib-src/makefile.w32-in     27 Sep 2009 08:27:28 -0000      2.101
--- lib-src/makefile.w32-in     9 Oct 2009 22:55:20 -0000
***************
*** 289,294 ****
--- 289,299 ----
        $(lispsource)window.elc \
        $(lispsource)version.el
  
+ # Used by batch-update-autoloads.
+ echolisp:
+       @echo $(lisp1)
+       @echo $(lisp2)
+ 
  # This is needed the first time we build the tree, since temacs.exe
  # does not exist yet, and the DOC rule needs it to rebuild DOC whenever
  # Emacs is rebuilt.
***************
*** 348,353 ****
--- 353,359 ----
                - $(DEL) getopt.h
                - $(DEL_TREE) $(OBJDIR)
                - $(DEL) stamp_BLD
+               - $(DEL) echolisp.tmp
  
  distclean: cleanall
        - $(DEL) TAGS
*** lisp/emacs-lisp/autoload.el 7 Oct 2009 16:10:37 -0000       1.149
--- lisp/emacs-lisp/autoload.el 9 Oct 2009 22:59:46 -0000
***************
*** 686,694 ****
    ;; 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))
           lim)
        (when (file-readable-p mfile)
        (with-temp-buffer
          (insert-file-contents mfile)
          (when (re-search-forward "^lisp= " nil t)
--- 686,717 ----
    ;; For use during the Emacs build process only.
    (unless autoload-excludes
      (let* ((ldir (file-name-directory generated-autoload-file))
!          (mdir (expand-file-name (if (eq system-type 'windows-nt)
!                                       "../lib-src"
!                                    "../src") ldir))
!          (mfile (expand-file-name "Makefile" mdir))
!          (tmpfile (expand-file-name "echolisp.tmp" mdir))
           lim)
        (when (file-readable-p mfile)
+       (if (eq system-type 'windows-nt)
+           (when (ignore-errors
+                  (delete-file tmpfile)
+                  (shell-command (format "make -C %s echolisp > %s"
+                                         mdir tmpfile))
+                  (file-readable-p tmpfile))
+             (with-temp-buffer
+               (insert-file-contents tmpfile)
+               (while (not (eobp))
+                 (setq lim (line-end-position))
+                 (while (re-search-forward "\\([^ ]+\\.el\\)c?\\>" lim t)
+                   (push (expand-file-name (match-string 1) mdir)
+                         autoload-excludes))
+                 (forward-line 1))))
+         ;; Non-Windows platforms do not use the echolisp approach
+         ;; because the maximum safe command-line length for all
+         ;; supported platforms is unknown.  Also it would seem a
+         ;; shame to split $lisp into $lisp1 etc just for the sake of
+         ;; this command (Windows requires it for other reasons).
          (with-temp-buffer
            (insert-file-contents mfile)
            (when (re-search-forward "^lisp= " nil t)
***************
*** 696,702 ****
            (while (re-search-forward "\\${lispsource}\\([^ ]+\\.el\\)c?\\>"
                                      lim t)
              (push (expand-file-name (match-string 1) ldir)
!                   autoload-excludes)))))))
    (let ((args command-line-args-left))
      (setq command-line-args-left nil)
      (apply 'update-directory-autoloads args)))
--- 719,725 ----
              (while (re-search-forward "\\${lispsource}\\([^ ]+\\.el\\)c?\\>"
                                        lim t)
                (push (expand-file-name (match-string 1) ldir)
!                     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]