Function: autoload-rubric

autoload-rubric is an autoloaded and byte-compiled function defined in autoload.el.gz.

Signature

(autoload-rubric FILE &optional TYPE FEATURE)

Documentation

Return a string giving the appropriate autoload rubric for FILE.

TYPE (default "autoloads") is a string stating the type of information contained in FILE. TYPE "package" acts like the default, but adds an extra line to the output to modify load-path.

If FEATURE is non-nil, FILE will provide a feature. FEATURE may be a string naming the feature, otherwise it will be based on FILE's name.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/autoload.el.gz
(defun autoload-rubric (file &optional type feature)
  "Return a string giving the appropriate autoload rubric for FILE.
TYPE (default \"autoloads\") is a string stating the type of
information contained in FILE.  TYPE \"package\" acts like the default,
but adds an extra line to the output to modify `load-path'.

If FEATURE is non-nil, FILE will provide a feature.  FEATURE may
be a string naming the feature, otherwise it will be based on
FILE's name."
  (let ((basename (file-name-nondirectory file))
	(lp (if (equal type "package") (setq type "autoloads"))))
    (concat ";;; " basename
            " --- automatically extracted " (or type "autoloads")
            "  -*- lexical-binding: t -*-\n"
	    ";;\n"
	    ";;; Code:\n\n"
	    (if lp
		"(add-to-list 'load-path (directory-file-name
                         (or (file-name-directory #$) (car load-path))))\n\n")
	    "\n"
	    ;; This is used outside of autoload.el, eg cus-dep, finder.
	    (if feature
		(format "(provide '%s)\n"
			(if (stringp feature) feature
			  (file-name-sans-extension basename))))
	    ";; Local Variables:\n"
	    ";; version-control: never\n"
            ";; no-byte-compile: t\n" ;; #$ is byte-compiled into nil.
	    ";; no-update-autoloads: t\n"
	    ";; coding: utf-8\n"
	    ";; End:\n"
	    ";;; " basename
	    " ends here\n")))