From: Glenn Morris Date: Thu, 5 Nov 2009 03:22:55 +0000 (+0000) Subject: (autoload-rubric): Add optional feature arg. X-Git-Tag: emacs-pretest-23.1.90~567 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4ad6a5e761216fdcdef4fa96fb266b8b18bd3fb5;p=emacs.git (autoload-rubric): Add optional feature arg. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a042130a79a..e93f347a973 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2009-11-05 Glenn Morris + * emacs-lisp/autoload.el (autoload-rubric): Add optional feature arg. + * calendar/diary-lib.el (top-level): Make load behave more like require. 2009-11-04 Dan Nicolaescu 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." (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"