aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2009-11-05 03:22:55 +0000
committerGlenn Morris2009-11-05 03:22:55 +0000
commit4ad6a5e761216fdcdef4fa96fb266b8b18bd3fb5 (patch)
treec1cd8a236876f17c319633ccbdd3252a280eadb1
parent4f8f657fc4dca1cc9bfde1462f212ad6249668dd (diff)
downloademacs-4ad6a5e761216fdcdef4fa96fb266b8b18bd3fb5.tar.gz
emacs-4ad6a5e761216fdcdef4fa96fb266b8b18bd3fb5.zip
(autoload-rubric): Add optional feature arg.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/emacs-lisp/autoload.el13
2 files changed, 13 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a042130a79a..e93f347a973 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12009-11-05 Glenn Morris <rgm@gnu.org> 12009-11-05 Glenn Morris <rgm@gnu.org>
2 2
3 * emacs-lisp/autoload.el (autoload-rubric): Add optional feature arg.
4
3 * calendar/diary-lib.el (top-level): Make load behave more like require. 5 * calendar/diary-lib.el (top-level): Make load behave more like require.
4 6
52009-11-04 Dan Nicolaescu <dann@ics.uci.edu> 72009-11-04 Dan Nicolaescu <dann@ics.uci.edu>
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 3485248c3cf..f15863f2631 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -253,16 +253,25 @@ put the output in."
253 (print-escape-nonascii t)) 253 (print-escape-nonascii t))
254 (print form outbuf))))))) 254 (print form outbuf)))))))
255 255
256(defun autoload-rubric (file &optional type) 256(defun autoload-rubric (file &optional type feature)
257 "Return a string giving the appropriate autoload rubric for FILE. 257 "Return a string giving the appropriate autoload rubric for FILE.
258TYPE (default \"autoloads\") is a string stating the type of 258TYPE (default \"autoloads\") is a string stating the type of
259information contained in FILE." 259information contained in FILE. If FEATURE is non-nil, FILE
260will provide a feature. FEATURE may be a string naming the
261feature, otherwise it will be based on FILE's name."
260 (let ((basename (file-name-nondirectory file))) 262 (let ((basename (file-name-nondirectory file)))
261 (concat ";;; " basename 263 (concat ";;; " basename
262 " --- automatically extracted " (or type "autoloads") "\n" 264 " --- automatically extracted " (or type "autoloads") "\n"
263 ";;\n" 265 ";;\n"
264 ";;; Code:\n\n" 266 ";;; Code:\n\n"
265 " \n" 267 " \n"
268 ;; This is used outside of autoload.el.
269 (if feature
270 (concat "(provide '"
271 (if (stringp feature) feature
272 (file-name-sans-extension basename))
273 ")\n")
274 "")
266 ";; Local Variables:\n" 275 ";; Local Variables:\n"
267 ";; version-control: never\n" 276 ";; version-control: never\n"
268 ";; no-byte-compile: t\n" 277 ";; no-byte-compile: t\n"