aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/autoload.el
diff options
context:
space:
mode:
authorGlenn Morris <[email protected]>2008-06-05 02:37:06 +0000
committerGlenn Morris <[email protected]>2008-06-05 02:37:06 +0000
commita98f63d48d277ebab72cb38090a48e2799531449 (patch)
tree7799bfd6759c8b389d935580e1f9324519d564c2 /lisp/emacs-lisp/autoload.el
parent2fe516326c2de4a2d3ce3e03c418fa326a31abcb (diff)
(autoload-rubric): New function, extracted from autoload-ensure-default-file.
(autoload-ensure-default-file): Use autoload-rubric.
Diffstat (limited to 'lisp/emacs-lisp/autoload.el')
-rw-r--r--lisp/emacs-lisp/autoload.el36
1 files changed, 20 insertions, 16 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index bbe7904c6e..343a2ce8ed 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -235,25 +235,29 @@ put the output in."
(print-escape-nonascii t))
(print form outbuf)))))))
+(defun autoload-rubric (file &optional type)
+ "Return a string giving the appropriate autoload rubric for FILE.
+TYPE (default \"autoloads\") is a string stating the type of
+information contained in FILE."
+ (let ((basename (file-name-nondirectory file)))
+ (concat ";;; " basename
+ " --- automatically extracted " (or type "autoloads") "\n"
+ ";;\n"
+ ";;; Code:\n\n"
+ " \n"
+ "(provide '" (file-name-sans-extension basename) ")\n"
+ ";; Local Variables:\n"
+ ";; version-control: never\n"
+ ";; no-byte-compile: t\n"
+ ";; no-update-autoloads: t\n"
+ ";; End:\n"
+ ";;; " basename
+ " ends here\n")))
+
(defun autoload-ensure-default-file (file)
"Make sure that the autoload file FILE exists and if not create it."
(unless (file-exists-p file)
- (let ((basename (file-name-nondirectory file)))
- (write-region
- (concat ";;; " basename
- " --- automatically extracted autoloads\n"
- ";;\n"
- ";;; Code:\n\n"
- " \n"
- "(provide '" (file-name-sans-extension basename) ")\n"
- ";; Local Variables:\n"
- ";; version-control: never\n"
- ";; no-byte-compile: t\n"
- ";; no-update-autoloads: t\n"
- ";; End:\n"
- ";;; " basename
- " ends here\n")
- nil file)))
+ (write-region (autoload-rubric file) nil file))
file)
(defun autoload-insert-section-header (outbuf autoloads load-name file time)