Function: use-package-handler/:vc

use-package-handler/:vc is a byte-compiled function defined in use-package-core.el.gz.

Signature

(use-package-handler/:vc NAME KEYWORD ARG REST STATE)

Documentation

Generate code to install package NAME, or do so directly.

When the use-package declaration is part of a byte-compiled file, install the package during compilation; otherwise, add it to the macro expansion and wait until runtime. The remaining arguments are as follows:

_KEYWORD is ignored.

ARG is the normalized input to the :vc keyword, as returned by the use-package-normalize/:vc function.

REST is a plist of other (following) keywords and their arguments, each having already been normalized by the respective function.

STATE is a plist of any state that keywords processed before
:vc (see use-package-keywords) may have accumulated.

Also see the Info node (use-package) Creating an extension.

Source Code

;; Defined in /usr/src/emacs/lisp/use-package/use-package-core.el.gz
(defun use-package-handler/:vc (name _keyword arg rest state)
  "Generate code to install package NAME, or do so directly.
When the use-package declaration is part of a byte-compiled file,
install the package during compilation; otherwise, add it to the
macro expansion and wait until runtime.  The remaining arguments
are as follows:

_KEYWORD is ignored.

ARG is the normalized input to the `:vc' keyword, as returned by
the `use-package-normalize/:vc' function.

REST is a plist of other (following) keywords and their
arguments, each having already been normalized by the respective
function.

STATE is a plist of any state that keywords processed before
`:vc' (see `use-package-keywords') may have accumulated.

Also see the Info node `(use-package) Creating an extension'."
  (let ((body (use-package-process-keywords name rest state))
        (local-path (car (plist-get state :load-path))))
    ;; See `use-package-handler/:ensure' for an explanation.
    (if (bound-and-true-p byte-compile-current-file)
        (funcall #'use-package-vc-install arg local-path)        ; compile time
      (push `(use-package-vc-install ',arg ,local-path) body))   ; runtime
    body))