bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#4446: remove ###autoload from ediff-hook.el


From: Glenn Morris
Subject: bug#4446: remove ###autoload from ediff-hook.el
Date: Sat, 26 Sep 2009 15:18:25 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Stefan Monnier wrote:

> Then you want the list that's in src/Makefile.in, since it includes the
> distinction between those files that are preloaded on all systems vs
> those that are system-dependent.

That's a good suggestion, thanks.

I found that setting preloaded-file-list in bootstrap-emacs does not
work anyway. At that stage files are being loaded uncompiled, so extra
files (eg cl) end up being added to preloaded-file-list due to
eval-when-compile.

Anyway, here's an attempt at your suggestion. The final version
probably should not print the "skipped" message.


Index: Makefile.in
===================================================================
RCS file: /sources/emacs/emacs/lisp/Makefile.in,v
retrieving revision 1.193
diff -c -c -w -r1.193 Makefile.in
*** Makefile.in 16 Sep 2009 03:10:17 -0000      1.193
--- Makefile.in 26 Sep 2009 19:16:12 -0000
***************
*** 131,143 ****
  
  # The chmod +w is to handle env var CVSREAD=1.  Files named
  # are identified by being the value of `generated-autoload-file'.
! autoloads: $(LOADDEFS) doit
        chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \
          $(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \
          $(lisp)/dired.el $(lisp)/ibuffer.el
        wd=$(lisp); $(setwins_almost); \
        echo Directories: $$wins; \
!       $(emacs) -l autoload --eval '(setq generated-autoload-file 
"$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
  
  # This is required by the bootstrap-emacs target in ../src/Makefile, so
  # we know that if we have an emacs executable, we also have a subdirs.el.
--- 131,146 ----
  
  # The chmod +w is to handle env var CVSREAD=1.  Files named
  # are identified by being the value of `generated-autoload-file'.
! # The Makefile dependency is to make any missing-file error more explicit.
! autoloads: $(LOADDEFS) ../src/Makefile doit
        chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \
          $(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \
          $(lisp)/dired.el $(lisp)/ibuffer.el
        wd=$(lisp); $(setwins_almost); \
        echo Directories: $$wins; \
!       preload=`sed -n -e '/^lisp=/ s/$${lispsource}//g p' ../src/Makefile | \
!         sed 's/^lisp= //'`; \
!       $(emacs) -l autoload --eval "(setq generated-autoload-file 
\"$(lisp)/loaddefs.el\" autoload-excludes \"$${preload}\")" -f 
batch-update-autoloads $$wins
  
  # This is required by the bootstrap-emacs target in ../src/Makefile, so
  # we know that if we have an emacs executable, we also have a subdirs.el.
Index: autoload.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/autoload.el,v
retrieving revision 1.143
diff -c -c -w -r1.143 autoload.el
*** autoload.el 5 Jan 2009 03:20:44 -0000       1.143
--- autoload.el 26 Sep 2009 19:16:22 -0000
***************
*** 58,63 ****
--- 58,66 ----
  read and an autoload made for it.  If there is further text on the line,
  that text will be copied verbatim to `generated-autoload-file'.")
  
+ (defvar autoload-excludes nil
+   "If non-nil, list of absolute file names not to scan for autoloads.")
+ 
  (defconst generate-autoload-section-header "\f\n;;;### "
    "String that marks the form at the start of a new file's autoload section.")
  
***************
*** 347,353 ****
            relfile
            ;; nil until we found a cookie.
            output-start)
! 
        (with-current-buffer (or visited
                                 ;; It is faster to avoid visiting the file.
                                 (autoload-find-file file))
--- 350,357 ----
            relfile
            ;; nil until we found a cookie.
            output-start)
!       (if (member absfile autoload-excludes)
!                 (message "Generating autoloads for %s...skipped" file)
        (with-current-buffer (or visited
                                 ;; It is faster to avoid visiting the file.
                                 (autoload-find-file file))
***************
*** 452,458 ****
            (message "Generating autoloads for %s...done" file))
          (or visited
              ;; We created this buffer, so we should kill it.
!             (kill-buffer (current-buffer))))
        ;; If the entries were added to some other buffer, then the file
        ;; doesn't add entries to OUTFILE.
        (or (not output-start) otherbuf))))
--- 456,462 ----
            (message "Generating autoloads for %s...done" file))
          (or visited
              ;; We created this buffer, so we should kill it.
!             (kill-buffer (current-buffer)))))
        ;; If the entries were added to some other buffer, then the file
        ;; doesn't add entries to OUTFILE.
        (or (not output-start) otherbuf))))
***************
*** 649,654 ****
--- 653,670 ----
  (defun batch-update-autoloads ()
    "Update loaddefs.el autoloads in batch mode.
  Calls `update-directory-autoloads' on the command line arguments."
+   ;; For use during the Emacs build process only.  We do the file-name
+   ;; expansion here rather than in lisp/Makefile in order to keep the
+   ;; shell command line short.  (Long lines are an issue on some systems.)
+   (if (stringp autoload-excludes)
+       (setq autoload-excludes
+           (mapcar
+            (lambda (file)
+              (concat
+               (expand-file-name (file-name-sans-extension file)
+                                 (file-name-directory generated-autoload-file))
+               ".el"))
+            (split-string 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]