]> git.eshelyaron.com Git - emacs.git/commitdiff
(autoload-rubric): Add optional feature arg.
authorGlenn Morris <rgm@gnu.org>
Thu, 5 Nov 2009 03:22:55 +0000 (03:22 +0000)
committerGlenn Morris <rgm@gnu.org>
Thu, 5 Nov 2009 03:22:55 +0000 (03:22 +0000)
lisp/ChangeLog
lisp/emacs-lisp/autoload.el

index a042130a79aa5ecca98479b5e9b8b7f2ff5d864b..e93f347a97361e8e96a13298cc3cde31a07938b8 100644 (file)
@@ -1,5 +1,7 @@
 2009-11-05  Glenn Morris  <rgm@gnu.org>
 
+       * 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  <dann@ics.uci.edu>
index 3485248c3cf8afb235c4ed08974992e051c1cc50..f15863f2631422ab3d4521618ddc332e2add72de 100644 (file)
@@ -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"
            "\f\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"