comparison lisp/emacs-lisp/autoload.el @ 105858:e413a8093e28

(autoload-rubric): Add optional feature arg.
author Glenn Morris <rgm@gnu.org>
date Thu, 05 Nov 2009 03:22:55 +0000
parents 83dde921cc1b
children 544761863e24
comparison
equal deleted inserted replaced
105857:900207956538 105858:e413a8093e28
251 (let ((print-escape-newlines t) 251 (let ((print-escape-newlines t)
252 (print-quoted t) 252 (print-quoted t)
253 (print-escape-nonascii t)) 253 (print-escape-nonascii t))
254 (print form outbuf))))))) 254 (print form outbuf)))))))
255 255
256 (defun autoload-rubric (file &optional type) 256 (defun autoload-rubric (file &optional type feature)
257 "Return a string giving the appropriate autoload rubric for FILE. 257 "Return a string giving the appropriate autoload rubric for FILE.
258 TYPE (default \"autoloads\") is a string stating the type of 258 TYPE (default \"autoloads\") is a string stating the type of
259 information contained in FILE." 259 information contained in FILE. If FEATURE is non-nil, FILE
260 will provide a feature. FEATURE may be a string naming the
261 feature, otherwise it will be based on FILE's name."
260 (let ((basename (file-name-nondirectory file))) 262 (let ((basename (file-name-nondirectory file)))
261 (concat ";;; " basename 263 (concat ";;; " basename
262 " --- automatically extracted " (or type "autoloads") "\n" 264 " --- automatically extracted " (or type "autoloads") "\n"
263 ";;\n" 265 ";;\n"
264 ";;; Code:\n\n" 266 ";;; Code:\n\n"
265 " \n" 267 " \n"
268 ;; This is used outside of autoload.el.
269 (if feature
270 (concat "(provide '"
271 (if (stringp feature) feature
272 (file-name-sans-extension basename))
273 ")\n")
274 "")
266 ";; Local Variables:\n" 275 ";; Local Variables:\n"
267 ";; version-control: never\n" 276 ";; version-control: never\n"
268 ";; no-byte-compile: t\n" 277 ";; no-byte-compile: t\n"
269 ";; no-update-autoloads: t\n" 278 ";; no-update-autoloads: t\n"
270 ";; coding: utf-8\n" 279 ";; coding: utf-8\n"