From a98f63d48d277ebab72cb38090a48e2799531449 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 5 Jun 2008 02:37:06 +0000 Subject: (autoload-rubric): New function, extracted from autoload-ensure-default-file. (autoload-ensure-default-file): Use autoload-rubric. --- lisp/emacs-lisp/autoload.el | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'lisp/emacs-lisp/autoload.el') diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index bbe7904c6e6..343a2ce8edf 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -235,25 +235,29 @@ put the output in." (print-escape-nonascii t)) (print form outbuf))))))) +(defun autoload-rubric (file &optional type) + "Return a string giving the appropriate autoload rubric for FILE. +TYPE (default \"autoloads\") is a string stating the type of +information contained in FILE." + (let ((basename (file-name-nondirectory file))) + (concat ";;; " basename + " --- automatically extracted " (or type "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"))) + (defun autoload-ensure-default-file (file) "Make sure that the autoload file FILE exists and if not create it." (unless (file-exists-p 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))) + (write-region (autoload-rubric file) nil file)) file) (defun autoload-insert-section-header (outbuf autoloads load-name file time) -- cgit v1.2.1