comparison lisp/emacs-lisp/autoload.el @ 105484:fe4228529c23

(autoload-excludes): New variable. (autoload-generate-file-autoloads): Skip files in autoload-excludes. (batch-update-autoloads): Process a string value of autoload-excludes, set during the build process.
author Glenn Morris <rgm@gnu.org>
date Tue, 06 Oct 2009 03:12:32 +0000
parents bd2966850aac
children e3e540de3898
comparison
equal deleted inserted replaced
105483:ada588cf3ad7 105484:fe4228529c23
67 \(defun function-to-be-autoloaded () ...) 67 \(defun function-to-be-autoloaded () ...)
68 68
69 If this string appears alone on a line, the following form will be 69 If this string appears alone on a line, the following form will be
70 read and an autoload made for it. If there is further text on the line, 70 read and an autoload made for it. If there is further text on the line,
71 that text will be copied verbatim to `generated-autoload-file'.") 71 that text will be copied verbatim to `generated-autoload-file'.")
72
73 (defvar autoload-excludes nil
74 "If non-nil, list of absolute file names not to scan for autoloads.")
72 75
73 (defconst generate-autoload-section-header "\f\n;;;### " 76 (defconst generate-autoload-section-header "\f\n;;;### "
74 "String that marks the form at the start of a new file's autoload section.") 77 "String that marks the form at the start of a new file's autoload section.")
75 78
76 (defconst generate-autoload-section-trailer "\n;;;***\n" 79 (defconst generate-autoload-section-trailer "\n;;;***\n"
371 (otherbuf nil) 374 (otherbuf nil)
372 (absfile (expand-file-name file)) 375 (absfile (expand-file-name file))
373 relfile 376 relfile
374 ;; nil until we found a cookie. 377 ;; nil until we found a cookie.
375 output-start) 378 output-start)
376 379 (if (member absfile autoload-excludes)
380 (message "Generating autoloads for %s...skipped" file)
377 (with-current-buffer (or visited 381 (with-current-buffer (or visited
378 ;; It is faster to avoid visiting the file. 382 ;; It is faster to avoid visiting the file.
379 (autoload-find-file file)) 383 (autoload-find-file file))
380 ;; Obey the no-update-autoloads file local variable. 384 ;; Obey the no-update-autoloads file local variable.
381 (unless no-update-autoloads 385 (unless no-update-autoloads
480 (insert ";;; Generated autoloads from " relfile "\n")) 484 (insert ";;; Generated autoloads from " relfile "\n"))
481 (insert generate-autoload-section-trailer)))) 485 (insert generate-autoload-section-trailer))))
482 (message "Generating autoloads for %s...done" file)) 486 (message "Generating autoloads for %s...done" file))
483 (or visited 487 (or visited
484 ;; We created this buffer, so we should kill it. 488 ;; We created this buffer, so we should kill it.
485 (kill-buffer (current-buffer)))) 489 (kill-buffer (current-buffer)))))
486 ;; If the entries were added to some other buffer, then the file 490 ;; If the entries were added to some other buffer, then the file
487 ;; doesn't add entries to OUTFILE. 491 ;; doesn't add entries to OUTFILE.
488 (or (not output-start) otherbuf)))) 492 (or (not output-start) otherbuf))))
489 493
490 (defun autoload-save-buffers () 494 (defun autoload-save-buffers ()
677 681
678 ;;;###autoload 682 ;;;###autoload
679 (defun batch-update-autoloads () 683 (defun batch-update-autoloads ()
680 "Update loaddefs.el autoloads in batch mode. 684 "Update loaddefs.el autoloads in batch mode.
681 Calls `update-directory-autoloads' on the command line arguments." 685 Calls `update-directory-autoloads' on the command line arguments."
686 ;; For use during the Emacs build process only. We do the file-name
687 ;; expansion here rather than in lisp/Makefile in order to keep the
688 ;; shell command line short. (Long lines are an issue on some systems.)
689 (if (stringp autoload-excludes)
690 (setq autoload-excludes
691 (mapcar
692 (lambda (file)
693 (concat
694 (expand-file-name (file-name-sans-extension file)
695 (file-name-directory generated-autoload-file))
696 ".el"))
697 (split-string autoload-excludes))))
682 (let ((args command-line-args-left)) 698 (let ((args command-line-args-left))
683 (setq command-line-args-left nil) 699 (setq command-line-args-left nil)
684 (apply 'update-directory-autoloads args))) 700 (apply 'update-directory-autoloads args)))
685 701
686 (provide 'autoload) 702 (provide 'autoload)