changeset 93710:07af23654bc8

(autoload-ensure-default-file): Provide a feature.
author Glenn Morris <rgm@gnu.org>
date Sat, 05 Apr 2008 18:51:12 +0000
parents 1471197c1a94
children 147f4f022b77
files lisp/emacs-lisp/autoload.el
diffstat 1 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/autoload.el	Sat Apr 05 18:47:34 2008 +0000
+++ b/lisp/emacs-lisp/autoload.el	Sat Apr 05 18:51:12 2008 +0000
@@ -240,19 +240,22 @@
 (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"
-	     "\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"
+	       "\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)