emacs-devel
[Top][All Lists]
Advanced

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

Re: ignoring autoloads in preloaded files on Windows


From: Glenn Morris
Subject: Re: ignoring autoloads in preloaded files on Windows
Date: Sat, 10 Oct 2009 17:17:27 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Thanks for the feedback. Here is a revised version.

*** lisp/makefile.w32-in.~1.99.~        2009-10-08 23:28:21.000000000 -0700
--- lisp/makefile.w32-in        2009-10-10 14:01:28.000000000 -0700
***************
*** 214,220 ****
        @echo Directories: . $(WINS_UPDATES)
        $(emacs) -l autoload \
                --eval $(ARGQUOTE)(setq find-file-hook nil 
find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
!               -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" . 
$(WINS_UPDATES)
  
  $(lisp)/subdirs.el:
        $(MAKE) $(MFLAGS) update-subdirs
--- 214,220 ----
        @echo Directories: . $(WINS_UPDATES)
        $(emacs) -l autoload \
                --eval $(ARGQUOTE)(setq find-file-hook nil 
find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
!               -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" $(MAKE) . 
$(WINS_UPDATES)
  
  $(lisp)/subdirs.el:
        $(MAKE) $(MFLAGS) update-subdirs

*** lisp/w32-fns.el.~1.97.~     2009-09-14 19:30:52.000000000 -0700
--- lisp/w32-fns.el     2009-10-10 14:01:19.000000000 -0700
***************
*** 490,496 ****
  munge command-line arguments that include file names to a horrible mess
  that Emacs is unable to cope with."
    (let ((generated-autoload-file
!        (expand-file-name (pop command-line-args-left))))
      (batch-update-autoloads)))
  
  (defun w32-append-code-lines (orig extra)
--- 490,497 ----
  munge command-line arguments that include file names to a horrible mess
  that Emacs is unable to cope with."
    (let ((generated-autoload-file
!        (expand-file-name (pop command-line-args-left)))
!       (autoload-make-program (pop command-line-args-left)))
      (batch-update-autoloads)))
  
  (defun w32-append-code-lines (orig extra)

*** lib-src/makefile.w32-in     27 Sep 2009 08:27:28 -0000      2.101
--- lib-src/makefile.w32-in     10 Oct 2009 21:13:32 -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 10 Oct 2009 21:14:02 -0000
***************
*** 679,684 ****
--- 679,687 ----
  (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,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)
--- 689,722 ----
    ;; For use during the Emacs build process only.
    (unless autoload-excludes
      (let* ((ldir (file-name-directory generated-autoload-file))
!          (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)
        (when (file-readable-p mfile)
+       (if (eq system-type 'windows-nt)
+           (when (ignore-errors
+                  (if (file-exists-p tmpfile) (delete-file tmpfile))
+                  (shell-command (format "%s echolisp > %s"
+                                         autoload-make-program 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))
+                         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)))
--- 724,730 ----
              (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]