Mercurial > emacs
comparison lisp/emacs-lisp/autoload.el @ 104447:273e528a9f9b
* emacs-lisp/autoload.el (generated-autoload-load-name): New var.
(autoload-generate-file-autoloads): Use it.
(make-autoload): Handle define-overloadable-function.
* emacs-lisp/lisp-mode.el (define-overloadable-function): Add
doc-string-elt property for define-overloadable-function.
lisp/cedet/semantic/analyze.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/ctxt.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/db.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/db-file.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/db-mode.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/db-typecache.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/doc.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/find.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/format.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/lex.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/sb.el: Require semantic/format.
lisp/cedet/semantic/sort.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/tag.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/tag-file.el: Add generated-autoload-load-name var.
lisp/cedet/semantic/tag-ls.el: Add generated-autoload-load-name var.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 05 Sep 2009 01:00:36 +0000 |
parents | 43eb1ff3a976 |
children | 5fabb7947fa5 |
comparison
equal
deleted
inserted
replaced
104446:df08b7ab0ba0 | 104447:273e528a9f9b |
---|---|
45 (defvar generated-autoload-feature nil | 45 (defvar generated-autoload-feature nil |
46 "*Feature that `generated-autoload-file' should provide. | 46 "*Feature that `generated-autoload-file' should provide. |
47 If nil, this defaults to `generated-autoload-file', sans extension.") | 47 If nil, this defaults to `generated-autoload-file', sans extension.") |
48 ;;;###autoload | 48 ;;;###autoload |
49 (put 'generated-autoload-feature 'safe-local-variable 'symbolp) | 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) | |
50 | 56 |
51 ;; 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 |
52 ;; ";;;###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. |
53 (defvar generate-autoload-cookie ";;;###autoload" | 59 (defvar generate-autoload-cookie ";;;###autoload" |
54 "Magic comment indicating the following form should be autoloaded. | 60 "Magic comment indicating the following form should be autoloaded. |
99 ((memq car '(defun define-skeleton defmacro define-derived-mode | 105 ((memq car '(defun define-skeleton defmacro define-derived-mode |
100 define-compilation-mode define-generic-mode | 106 define-compilation-mode define-generic-mode |
101 easy-mmode-define-global-mode define-global-minor-mode | 107 easy-mmode-define-global-mode define-global-minor-mode |
102 define-globalized-minor-mode | 108 define-globalized-minor-mode |
103 easy-mmode-define-minor-mode define-minor-mode | 109 easy-mmode-define-minor-mode define-minor-mode |
104 defun* defmacro*)) | 110 defun* defmacro* define-overloadable-function)) |
105 (let* ((macrop (memq car '(defmacro defmacro*))) | 111 (let* ((macrop (memq car '(defmacro defmacro*))) |
106 (name (nth 1 form)) | 112 (name (nth 1 form)) |
107 (args (case car | 113 (args (case car |
108 ((defun defmacro defun* defmacro*) (nth 2 form)) | 114 ((defun defmacro defun* defmacro* |
115 define-overloadable-function) (nth 2 form)) | |
109 ((define-skeleton) '(&optional str arg)) | 116 ((define-skeleton) '(&optional str arg)) |
110 ((define-generic-mode define-derived-mode | 117 ((define-generic-mode define-derived-mode |
111 define-compilation-mode) nil) | 118 define-compilation-mode) nil) |
112 (t))) | 119 (t))) |
113 (body (nthcdr (get car 'doc-string-elt) form)) | 120 (body (nthcdr (get car 'doc-string-elt) form)) |
345 | 352 |
346 Return non-nil if and only if FILE adds no autoloads to OUTFILE | 353 Return non-nil if and only if FILE adds no autoloads to OUTFILE |
347 \(or OUTBUF if OUTFILE is nil)." | 354 \(or OUTBUF if OUTFILE is nil)." |
348 (catch 'done | 355 (catch 'done |
349 (let ((autoloads-done '()) | 356 (let ((autoloads-done '()) |
350 (load-name (autoload-file-load-name file)) | 357 load-name |
351 (print-length nil) | 358 (print-length nil) |
352 (print-level nil) | 359 (print-level nil) |
353 (print-readably t) ; This does something in Lucid Emacs. | 360 (print-readably t) ; This does something in Lucid Emacs. |
354 (float-output-format nil) | 361 (float-output-format nil) |
355 (visited (get-file-buffer file)) | 362 (visited (get-file-buffer file)) |
363 ;; It is faster to avoid visiting the file. | 370 ;; It is faster to avoid visiting the file. |
364 (autoload-find-file file)) | 371 (autoload-find-file file)) |
365 ;; Obey the no-update-autoloads file local variable. | 372 ;; Obey the no-update-autoloads file local variable. |
366 (unless no-update-autoloads | 373 (unless no-update-autoloads |
367 (message "Generating autoloads for %s..." file) | 374 (message "Generating autoloads for %s..." file) |
375 (setq load-name | |
376 (if (stringp generated-autoload-load-name) | |
377 generated-autoload-load-name | |
378 (autoload-file-load-name file))) | |
368 (save-excursion | 379 (save-excursion |
369 (save-restriction | 380 (save-restriction |
370 (widen) | 381 (widen) |
371 (goto-char (point-min)) | 382 (goto-char (point-min)) |
372 (while (not (eobp)) | 383 (while (not (eobp)) |