comparison lisp/emacs-lisp/autoload.el @ 95558:8c1e2d447217

(autoload-rubric): New function, extracted from autoload-ensure-default-file. (autoload-ensure-default-file): Use autoload-rubric.
author Glenn Morris <rgm@gnu.org>
date Thu, 05 Jun 2008 02:36:56 +0000
parents 9a5b7d040f2b
children e54e9f3fbb29
comparison
equal deleted inserted replaced
95557:066448b675c8 95558:8c1e2d447217
233 (let ((print-escape-newlines t) 233 (let ((print-escape-newlines t)
234 (print-quoted t) 234 (print-quoted t)
235 (print-escape-nonascii t)) 235 (print-escape-nonascii t))
236 (print form outbuf))))))) 236 (print form outbuf)))))))
237 237
238 (defun autoload-rubric (file &optional type)
239 "Return a string giving the appropriate autoload rubric for FILE.
240 TYPE (default \"autoloads\") is a string stating the type of
241 information contained in FILE."
242 (let ((basename (file-name-nondirectory file)))
243 (concat ";;; " basename
244 " --- automatically extracted " (or type "autoloads") "\n"
245 ";;\n"
246 ";;; Code:\n\n"
247 " \n"
248 "(provide '" (file-name-sans-extension basename) ")\n"
249 ";; Local Variables:\n"
250 ";; version-control: never\n"
251 ";; no-byte-compile: t\n"
252 ";; no-update-autoloads: t\n"
253 ";; End:\n"
254 ";;; " basename
255 " ends here\n")))
256
238 (defun autoload-ensure-default-file (file) 257 (defun autoload-ensure-default-file (file)
239 "Make sure that the autoload file FILE exists and if not create it." 258 "Make sure that the autoload file FILE exists and if not create it."
240 (unless (file-exists-p file) 259 (unless (file-exists-p file)
241 (let ((basename (file-name-nondirectory file))) 260 (write-region (autoload-rubric file) nil file))
242 (write-region
243 (concat ";;; " basename
244 " --- automatically extracted autoloads\n"
245 ";;\n"
246 ";;; Code:\n\n"
247 " \n"
248 "(provide '" (file-name-sans-extension basename) ")\n"
249 ";; Local Variables:\n"
250 ";; version-control: never\n"
251 ";; no-byte-compile: t\n"
252 ";; no-update-autoloads: t\n"
253 ";; End:\n"
254 ";;; " basename
255 " ends here\n")
256 nil file)))
257 file) 261 file)
258 262
259 (defun autoload-insert-section-header (outbuf autoloads load-name file time) 263 (defun autoload-insert-section-header (outbuf autoloads load-name file time)
260 "Insert the section-header line, 264 "Insert the section-header line,
261 which lists the file name and which functions are in it, etc." 265 which lists the file name and which functions are in it, etc."