Function: package-vc-install-from-checkout
package-vc-install-from-checkout is an autoloaded, interactive and
byte-compiled function defined in package-vc.el.gz.
This command is obsolete since 31.1; use the User Lisp directory instead.
Signature
(package-vc-install-from-checkout DIR &optional NAME INTERACTIVE)
Documentation
Install the package NAME from its source directory DIR.
NAME defaults to the base name of DIR. Interactively, prompt the user
for DIR, which should be a directory under version control, typically
one created by package-vc-checkout. If invoked interactively with a
prefix argument, prompt the user for the NAME of the package to set up.
If the optional argument INTERACTIVE is non-nil (as happens
interactively), DIR must be an absolute file name.
Probably introduced at or before Emacs version 29.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/package-vc.el.gz
;;;###autoload
(defun package-vc-install-from-checkout (dir &optional name interactive)
"Install the package NAME from its source directory DIR.
NAME defaults to the base name of DIR. Interactively, prompt the user
for DIR, which should be a directory under version control, typically
one created by `package-vc-checkout'. If invoked interactively with a
prefix argument, prompt the user for the NAME of the package to set up.
If the optional argument INTERACTIVE is non-nil (as happens
interactively), DIR must be an absolute file name."
(declare (obsolete "use the User Lisp directory instead." "31.1"))
(interactive (let ((dir (expand-file-name (read-directory-name "Directory: "))))
(list dir (and current-prefix-arg
(let ((base (file-name-base
(directory-file-name
dir))))
(read-string
(format-prompt "Package name" base)
nil nil base)))
:interactive)))
(package-vc--archives-initialize)
(let* ((dir (if interactive dir (expand-file-name dir))) ;avoid double expansion
(name (or name (file-name-base (directory-file-name dir))))
(pkg-dir (file-name-concat package-user-dir name)))
(when (file-exists-p pkg-dir)
(if (yes-or-no-p (format "Overwrite previous checkout for package `%s'?" name))
(package--delete-directory pkg-dir)
(error "There already exists a checkout for %s" name)))
(make-directory pkg-dir t)
;; We store a custom package specification so that it is available
;; for `package-vc--unpack-1' as well as `package-vc--checkout-dir'
;; can later retrieve the actual checkout.
(package-vc--unpack-1
(package-desc-create
:name (intern name)
:extras (and (not (file-equal-p pkg-dir dir))
`((:vc-dir . ,dir)))
:dir pkg-dir
:kind 'vc))))