diff options
author | Glenn Morris <rgm@gnu.org> | 2008-06-05 02:37:06 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2008-06-05 02:37:06 +0000 |
commit | a98f63d48d277ebab72cb38090a48e2799531449 (patch) | |
tree | 7799bfd6759c8b389d935580e1f9324519d564c2 /lisp/emacs-lisp | |
parent | 2fe516326c2de4a2d3ce3e03c418fa326a31abcb (diff) | |
download | emacs-a98f63d48d277ebab72cb38090a48e2799531449.tar.gz emacs-a98f63d48d277ebab72cb38090a48e2799531449.tar.bz2 emacs-a98f63d48d277ebab72cb38090a48e2799531449.zip |
(autoload-rubric): New function, extracted from autoload-ensure-default-file.
(autoload-ensure-default-file): Use autoload-rubric.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/autoload.el | 36 |
1 files changed, 20 insertions, 16 deletions
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) |