]> git.eshelyaron.com Git - emacs.git/commitdiff
(autoload-ensure-default-file): Provide a feature.
authorGlenn Morris <rgm@gnu.org>
Sat, 5 Apr 2008 18:51:12 +0000 (18:51 +0000)
committerGlenn Morris <rgm@gnu.org>
Sat, 5 Apr 2008 18:51:12 +0000 (18:51 +0000)
lisp/emacs-lisp/autoload.el

index dadb6aa0ea8ffc0a393b57a03292a21c3b695e4e..e6bca3b15dde0cb3d046c0dbd7328bd535c7254a 100644 (file)
@@ -240,19 +240,22 @@ put the output in."
 (defun autoload-ensure-default-file (file)
   "Make sure that the autoload file FILE exists and if not create it."
   (unless (file-exists-p file)
-    (write-region
-     (concat ";;; " (file-name-nondirectory file)
-            " --- automatically extracted autoloads\n"
-            ";;\n"
-            ";;; Code:\n\n"
-            "\f\n;; Local Variables:\n"
-            ";; version-control: never\n"
-            ";; no-byte-compile: t\n"
-            ";; no-update-autoloads: t\n"
-            ";; End:\n"
-            ";;; " (file-name-nondirectory file)
-            " ends here\n")
-     nil file))
+    (let ((basename (file-name-nondirectory file)))
+      (write-region
+       (concat ";;; " basename
+              " --- automatically extracted autoloads\n"
+              ";;\n"
+              ";;; Code:\n\n"
+              "\f\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)))
   file)
 
 (defun autoload-insert-section-header (outbuf autoloads load-name file time)