comparison lisp/emacs-lisp/autoload.el @ 105235:f2e56d1eff32

* menu-bar.el: Remove menu-bar-ediff-misc-menu from the Tools menu. * ediff-hook.el: Move menu-bar-ediff-misc-menu into menu-bar-ediff-menu. * emacs-lisp/lisp-mode.el: Add doc-string-elt property to define-overloadable-function. * progmodes/autoconf.el: Provide autoconf as well, so that this file can be `require'd. * emacs-lisp/cl-macs.el (deftype): Add to cl-loaddefs. * emacs-lisp/autoload.el (generated-autoload-feature) (generated-autoload-load-name): New vars. (autoload-rubric, autoload-generate-file-autoloads): Use them. (make-autoload): Recognize define-overloadable-function and defclass forms (for EIEIO). * Makefile.in (update-subdirs): Exclude cedet directory.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 27 Sep 2009 23:25:03 +0000
parents a9dc0e7c3f2b
children bd2966850aac
comparison
equal deleted inserted replaced
105234:bb13a70d9c32 105235:f2e56d1eff32
39 A `.el' file can set this in its local variables section to make its 39 A `.el' file can set this in its local variables section to make its
40 autoloads go somewhere else. The autoload file is assumed to contain a 40 autoloads go somewhere else. The autoload file is assumed to contain a
41 trailer starting with a FormFeed character.") 41 trailer starting with a FormFeed character.")
42 ;;;###autoload 42 ;;;###autoload
43 (put 'generated-autoload-file 'safe-local-variable 'stringp) 43 (put 'generated-autoload-file 'safe-local-variable 'stringp)
44
45 (defvar generated-autoload-feature nil
46 "Feature for `generated-autoload-file' to provide.
47 If nil, this defaults to `generated-autoload-file', sans extension.")
48 ;;;###autoload
49 (put 'generated-autoload-feature 'safe-local-variable 'symbolp)
50
51 (defvar generated-autoload-load-name nil
52 "Load name for `autoload' statements generated from autoload cookies.
53 If nil, this defaults to the file name, sans extension.")
54 ;;;###autoload
55 (put 'generated-autoload-load-name 'safe-local-variable 'stringp)
44 56
45 ;; This feels like it should be a defconst, but MH-E sets it to 57 ;; This feels like it should be a defconst, but MH-E sets it to
46 ;; ";;;###mh-autoload" for the autoloads that are to go into mh-loaddefs.el. 58 ;; ";;;###mh-autoload" for the autoloads that are to go into mh-loaddefs.el.
47 (defvar generate-autoload-cookie ";;;###autoload" 59 (defvar generate-autoload-cookie ";;;###autoload"
48 "Magic comment indicating the following form should be autoloaded. 60 "Magic comment indicating the following form should be autoloaded.
93 ((memq car '(defun define-skeleton defmacro define-derived-mode 105 ((memq car '(defun define-skeleton defmacro define-derived-mode
94 define-compilation-mode define-generic-mode 106 define-compilation-mode define-generic-mode
95 easy-mmode-define-global-mode define-global-minor-mode 107 easy-mmode-define-global-mode define-global-minor-mode
96 define-globalized-minor-mode 108 define-globalized-minor-mode
97 easy-mmode-define-minor-mode define-minor-mode 109 easy-mmode-define-minor-mode define-minor-mode
98 defun* defmacro*)) 110 defun* defmacro* define-overloadable-function))
99 (let* ((macrop (memq car '(defmacro defmacro*))) 111 (let* ((macrop (memq car '(defmacro defmacro*)))
100 (name (nth 1 form)) 112 (name (nth 1 form))
101 (args (case car 113 (args (case car
102 ((defun defmacro defun* defmacro*) (nth 2 form)) 114 ((defun defmacro defun* defmacro*
115 define-overloadable-function) (nth 2 form))
103 ((define-skeleton) '(&optional str arg)) 116 ((define-skeleton) '(&optional str arg))
104 ((define-generic-mode define-derived-mode 117 ((define-generic-mode define-derived-mode
105 define-compilation-mode) nil) 118 define-compilation-mode) nil)
106 (t))) 119 (t)))
107 (body (nthcdr (get car 'doc-string-elt) form)) 120 (body (nthcdr (get car 'doc-string-elt) form))
119 define-globalized-minor-mode 132 define-globalized-minor-mode
120 easy-mmode-define-minor-mode 133 easy-mmode-define-minor-mode
121 define-minor-mode)) t) 134 define-minor-mode)) t)
122 (eq (car-safe (car body)) 'interactive)) 135 (eq (car-safe (car body)) 'interactive))
123 (if macrop (list 'quote 'macro) nil)))) 136 (if macrop (list 'quote 'macro) nil))))
137
138 ;; For defclass forms, use `eieio-defclass-autoload'.
139 ((eq car 'defclass)
140 (let ((name (nth 1 form))
141 (superclasses (nth 2 form))
142 (doc (nth 4 form)))
143 (list 'eieio-defclass-autoload (list 'quote name)
144 (list 'quote superclasses) file doc)))
124 145
125 ;; Convert defcustom to less space-consuming data. 146 ;; Convert defcustom to less space-consuming data.
126 ((eq car 'defcustom) 147 ((eq car 'defcustom)
127 (let ((varname (car-safe (cdr-safe form))) 148 (let ((varname (car-safe (cdr-safe form)))
128 (init (car-safe (cdr-safe (cdr-safe form)))) 149 (init (car-safe (cdr-safe (cdr-safe form))))
243 (concat ";;; " basename 264 (concat ";;; " basename
244 " --- automatically extracted " (or type "autoloads") "\n" 265 " --- automatically extracted " (or type "autoloads") "\n"
245 ";;\n" 266 ";;\n"
246 ";;; Code:\n\n" 267 ";;; Code:\n\n"
247 " \n" 268 " \n"
248 "(provide '" (file-name-sans-extension basename) ")\n" 269 "(provide '"
270 (if (and generated-autoload-feature
271 (symbolp generated-autoload-feature))
272 (format "%s" generated-autoload-feature)
273 (file-name-sans-extension basename))
274 ")\n"
249 ";; Local Variables:\n" 275 ";; Local Variables:\n"
250 ";; version-control: never\n" 276 ";; version-control: never\n"
251 ";; no-byte-compile: t\n" 277 ";; no-byte-compile: t\n"
252 ";; no-update-autoloads: t\n" 278 ";; no-update-autoloads: t\n"
253 ";; coding: utf-8\n" 279 ";; coding: utf-8\n"
334 360
335 Return non-nil if and only if FILE adds no autoloads to OUTFILE 361 Return non-nil if and only if FILE adds no autoloads to OUTFILE
336 \(or OUTBUF if OUTFILE is nil)." 362 \(or OUTBUF if OUTFILE is nil)."
337 (catch 'done 363 (catch 'done
338 (let ((autoloads-done '()) 364 (let ((autoloads-done '())
339 (load-name (autoload-file-load-name file)) 365 load-name
340 (print-length nil) 366 (print-length nil)
341 (print-level nil) 367 (print-level nil)
342 (print-readably t) ; This does something in Lucid Emacs. 368 (print-readably t) ; This does something in Lucid Emacs.
343 (float-output-format nil) 369 (float-output-format nil)
344 (visited (get-file-buffer file)) 370 (visited (get-file-buffer file))
352 ;; It is faster to avoid visiting the file. 378 ;; It is faster to avoid visiting the file.
353 (autoload-find-file file)) 379 (autoload-find-file file))
354 ;; Obey the no-update-autoloads file local variable. 380 ;; Obey the no-update-autoloads file local variable.
355 (unless no-update-autoloads 381 (unless no-update-autoloads
356 (message "Generating autoloads for %s..." file) 382 (message "Generating autoloads for %s..." file)
383 (setq load-name
384 (if (stringp generated-autoload-load-name)
385 generated-autoload-load-name
386 (autoload-file-load-name file)))
357 (save-excursion 387 (save-excursion
358 (save-restriction 388 (save-restriction
359 (widen) 389 (widen)
360 (goto-char (point-min)) 390 (goto-char (point-min))
361 (while (not (eobp)) 391 (while (not (eobp))