comparison lisp/emacs-lisp/autoload.el @ 19170:ecc4375537e3

(update-autoloads-from-directories): Don't process file names that start with `.'.
author Richard M. Stallman <rms@gnu.org>
date Tue, 05 Aug 1997 17:16:00 +0000
parents 962be4e083c2
children 50857b41060a
comparison
equal deleted inserted replaced
19169:0ffc25f09344 19170:ecc4375537e3
28 ;; date. It interprets magic cookies of the form ";;;###autoload" in 28 ;; date. It interprets magic cookies of the form ";;;###autoload" in
29 ;; lisp source files in various useful ways. To learn more, read the 29 ;; lisp source files in various useful ways. To learn more, read the
30 ;; source; if you're going to use this, you'd better be able to. 30 ;; source; if you're going to use this, you'd better be able to.
31 31
32 ;;; Code: 32 ;;; Code:
33
34 (defvar generated-autoload-file "loaddefs.el"
35 "*File \\[update-file-autoloads] puts autoloads into.
36 A `.el' file can set this in its local variables section to make its
37 autoloads go somewhere else.")
38
39 (defconst generate-autoload-cookie ";;;###autoload"
40 "Magic comment indicating the following form should be autoloaded.
41 Used by \\[update-file-autoloads]. This string should be
42 meaningless to Lisp (e.g., a comment).
43
44 This string is used:
45
46 ;;;###autoload
47 \(defun function-to-be-autoloaded () ...)
48
49 If this string appears alone on a line, the following form will be
50 read and an autoload made for it. If there is further text on the line,
51 that text will be copied verbatim to `generated-autoload-file'.")
52
53 (defconst generate-autoload-section-header "\f\n;;;### "
54 "String inserted before the form identifying
55 the section of autoloads for a file.")
56
57 (defconst generate-autoload-section-trailer "\n;;;***\n"
58 "String which indicates the end of the section of autoloads for a file.")
33 59
34 (defun make-autoload (form file) 60 (defun make-autoload (form file)
35 "Turn FORM into an autoload or defvar for source file FILE. 61 "Turn FORM into an autoload or defvar for source file FILE.
36 Returns nil if FORM is not a defun, define-skeleton, defmacro or defcustom." 62 Returns nil if FORM is not a defun, define-skeleton, defmacro or defcustom."
37 (let ((car (car-safe form))) 63 (let ((car (car-safe form)))
68 (custom-add-load ',varname 94 (custom-add-load ',varname
69 ,(plist-get rest :require))))) 95 ,(plist-get rest :require)))))
70 nil)))) 96 nil))))
71 97
72 (put 'define-skeleton 'doc-string-elt 3) 98 (put 'define-skeleton 'doc-string-elt 3)
73
74 (defconst generate-autoload-cookie ";;;###autoload"
75 "Magic comment indicating the following form should be autoloaded.
76 Used by \\[update-file-autoloads]. This string should be
77 meaningless to Lisp (e.g., a comment).
78
79 This string is used:
80
81 ;;;###autoload
82 \(defun function-to-be-autoloaded () ...)
83
84 If this string appears alone on a line, the following form will be
85 read and an autoload made for it. If there is further text on the line,
86 that text will be copied verbatim to `generated-autoload-file'.")
87
88 (defconst generate-autoload-section-header "\f\n;;;### "
89 "String inserted before the form identifying
90 the section of autoloads for a file.")
91
92 (defconst generate-autoload-section-trailer "\n;;;***\n"
93 "String which indicates the end of the section of autoloads for a file.")
94 99
95 ;;; Forms which have doc-strings which should be printed specially. 100 ;;; Forms which have doc-strings which should be printed specially.
96 ;;; A doc-string-elt property of ELT says that (nth ELT FORM) is 101 ;;; A doc-string-elt property of ELT says that (nth ELT FORM) is
97 ;;; the doc-string in FORM. 102 ;;; the doc-string in FORM.
98 ;;; 103 ;;;
285 (forward-line 1)) 290 (forward-line 1))
286 (goto-char output-end) 291 (goto-char output-end)
287 (insert generate-autoload-section-trailer))) 292 (insert generate-autoload-section-trailer)))
288 (message "Generating autoloads for %s...done" file))) 293 (message "Generating autoloads for %s...done" file)))
289 294
290 (defvar generated-autoload-file "loaddefs.el"
291 "*File \\[update-file-autoloads] puts autoloads into.
292 A `.el' file can set this in its local variables section to make its
293 autoloads go somewhere else.")
294
295 ;;;###autoload 295 ;;;###autoload
296 (defun update-file-autoloads (file) 296 (defun update-file-autoloads (file)
297 "Update the autoloads for FILE in `generated-autoload-file' 297 "Update the autoloads for FILE in `generated-autoload-file'
298 \(which FILE might bind in its local variables)." 298 \(which FILE might bind in its local variables)."
299 (interactive "fUpdate autoloads for file: ") 299 (interactive "fUpdate autoloads for file: ")
396 (interactive "DUpdate autoloads from directory: ") 396 (interactive "DUpdate autoloads from directory: ")
397 (let ((files (apply 'nconc 397 (let ((files (apply 'nconc
398 (mapcar (function (lambda (dir) 398 (mapcar (function (lambda (dir)
399 (directory-files (expand-file-name dir) 399 (directory-files (expand-file-name dir)
400 t 400 t
401 "^[^=].*\\.el$"))) 401 "^[^=.].*\\.el$")))
402 dirs))) 402 dirs)))
403 autoloads-file 403 autoloads-file
404 top-dir) 404 top-dir)
405 (setq autoloads-file 405 (setq autoloads-file
406 (expand-file-name generated-autoload-file 406 (expand-file-name generated-autoload-file