aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/autoload.el
diff options
context:
space:
mode:
authorGlenn Morris <[email protected]>2009-11-05 03:22:55 +0000
committerGlenn Morris <[email protected]>2009-11-05 03:22:55 +0000
commit4ad6a5e761216fdcdef4fa96fb266b8b18bd3fb5 (patch)
treec1cd8a236876f17c319633ccbdd3252a280eadb1 /lisp/emacs-lisp/autoload.el
parent4f8f657fc4dca1cc9bfde1462f212ad6249668dd (diff)
(autoload-rubric): Add optional feature arg.
Diffstat (limited to 'lisp/emacs-lisp/autoload.el')
-rw-r--r--lisp/emacs-lisp/autoload.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 3485248c3c..f15863f263 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -253,16 +253,25 @@ put the output in."
(print-escape-nonascii t))
(print form outbuf)))))))
-(defun autoload-rubric (file &optional type)
+(defun autoload-rubric (file &optional type feature)
"Return a string giving the appropriate autoload rubric for FILE.
TYPE (default \"autoloads\") is a string stating the type of
-information contained in FILE."
+information contained in FILE. If FEATURE is non-nil, FILE
+will provide a feature. FEATURE may be a string naming the
+feature, otherwise it will be based on FILE's name."
(let ((basename (file-name-nondirectory file)))
(concat ";;; " basename
" --- automatically extracted " (or type "autoloads") "\n"
";;\n"
";;; Code:\n\n"
" \n"
+ ;; This is used outside of autoload.el.
+ (if feature
+ (concat "(provide '"
+ (if (stringp feature) feature
+ (file-name-sans-extension basename))
+ ")\n")
+ "")
";; Local Variables:\n"
";; version-control: never\n"
";; no-byte-compile: t\n"