Function: package-generate-autoloads

package-generate-autoloads is a byte-compiled function defined in package.el.gz.

Signature

(package-generate-autoloads NAME PKG-DIR)

Documentation

Generate autoloads in PKG-DIR for package named NAME.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/package.el.gz
(defun package-generate-autoloads (name pkg-dir)
  "Generate autoloads in PKG-DIR for package named NAME."
  (let* ((auto-name (format "%s-autoloads.el" name))
         ;;(ignore-name (concat name "-pkg.el"))
         (output-file (expand-file-name auto-name pkg-dir))
         ;; We don't need 'em, and this makes the output reproducible.
         (autoload-timestamps nil)
         (backup-inhibited t)
         (version-control 'never))
    (loaddefs-generate
     pkg-dir output-file nil
     (prin1-to-string
      '(add-to-list
        'load-path
        ;; Add the directory that will contain the autoload file to
        ;; the load path.  We don't hard-code `pkg-dir', to avoid
        ;; issues if the package directory is moved around.
        ;; `loaddefs-generate' has code to do this for us, but it's
        ;; not currently exposed.  (Bug#63625)
        (or (and load-file-name
                 (directory-file-name
                  (file-name-directory load-file-name)))
             (car load-path)))))
    (let ((buf (find-buffer-visiting output-file)))
      (when buf (kill-buffer buf)))
    auto-name))