Mercurial > emacs
comparison lisp/emacs-lisp/autoload.el @ 727:540b047ece4d
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Wed, 24 Jun 1992 05:09:26 +0000 |
parents | 8a533acedb77 |
children | a8d94735277e |
comparison
equal
deleted
inserted
replaced
726:5f08efa38dd0 | 727:540b047ece4d |
---|---|
57 the section of autoloads for a file.") | 57 the section of autoloads for a file.") |
58 | 58 |
59 (defconst generate-autoload-section-trailer "\n;;;***\n" | 59 (defconst generate-autoload-section-trailer "\n;;;***\n" |
60 "String which indicates the end of the section of autoloads for a file.") | 60 "String which indicates the end of the section of autoloads for a file.") |
61 | 61 |
62 ;; Forms which have doc-strings which should be printed specially. | 62 ;;; Forms which have doc-strings which should be printed specially. |
63 ;; A doc-string-elt property of ELT says that (nth ELT FORM) is | 63 ;;; A doc-string-elt property of ELT says that (nth ELT FORM) is |
64 ;; the doc-string in FORM. | 64 ;;; the doc-string in FORM. |
65 ;; Note: defconst and defvar should NOT be marked in this way. | 65 ;;; |
66 ;; We don't want to produce defconsts and defvars that make-docfile can | 66 ;;; There used to be the following note here: |
67 ;; grok, because then it would grok them twice, once in foo.el (where they | 67 ;;; ;;; Note: defconst and defvar should NOT be marked in this way. |
68 ;; are given with ;;;###autoload) and once in loaddefs.el. | 68 ;;; ;;; We don't want to produce defconsts and defvars that |
69 ;;; ;;; make-docfile can grok, because then it would grok them twice, | |
70 ;;; ;;; once in foo.el (where they are given with ;;;###autoload) and | |
71 ;;; ;;; once in loaddefs.el. | |
72 ;;; | |
73 ;;; Counter-note: Yes, they should be marked in this way. | |
74 ;;; make-docfile only processes those files that are loaded into the | |
75 ;;; dumped Emacs, and those files should never have anything | |
76 ;;; autoloaded here. The above-feared problem only occurs with files | |
77 ;;; which have autoloaded entries *and* are processed by make-docfile; | |
78 ;;; there should be no such files. | |
79 | |
69 (put 'autoload 'doc-string-elt 3) | 80 (put 'autoload 'doc-string-elt 3) |
81 (put 'defun 'doc-string-elt 3) | |
82 (put 'defvar 'doc-string-elt 3) | |
83 (put 'defconst 'doc-string-elt 3) | |
84 (put 'defmacro 'doc-string-elt 3) | |
70 | 85 |
71 (defun generate-file-autoloads (file) | 86 (defun generate-file-autoloads (file) |
72 "Insert at point a loaddefs autoload section for FILE. | 87 "Insert at point a loaddefs autoload section for FILE. |
73 autoloads are generated for defuns and defmacros in FILE | 88 autoloads are generated for defuns and defmacros in FILE |
74 marked by `generate-autoload-regexp' (which see). | 89 marked by `generate-autoload-regexp' (which see). |
84 name))) | 99 name))) |
85 (print-length nil) | 100 (print-length nil) |
86 (floating-output-format "%20e") | 101 (floating-output-format "%20e") |
87 (done-any nil) | 102 (done-any nil) |
88 output-end) | 103 output-end) |
104 | |
105 ;; If the autoload section we create here uses an absolute | |
106 ;; pathname for FILE in its header, and then Emacs is installed | |
107 ;; under a different path on another system, | |
108 ;; `update-autoloads-here' won't be able to find the files to be | |
109 ;; autoloaded. So, if FILE is in the same directory or a | |
110 ;; subdirectory of the current buffer's file, we'll make it | |
111 ;; relative to the current buffer's directory. | |
112 (setq file (expand-file-name file)) | |
113 (if (and (< (length default-directory) (length file)) | |
114 (string= default-directory | |
115 (substring file 0 (length default-directory)))) | |
116 (progn | |
117 (setq file (substring file (length default-directory))))) | |
118 | |
89 (message "Generating autoloads for %s..." file) | 119 (message "Generating autoloads for %s..." file) |
90 (save-excursion | 120 (save-excursion |
91 (set-buffer inbuf) | 121 (set-buffer inbuf) |
92 (save-excursion | 122 (save-excursion |
93 (save-restriction | 123 (save-restriction |