From: Joseph Turner Date: Sun, 8 Oct 2023 21:29:23 +0000 (+0200) Subject: Make package-vc-install-from-checkout NAME argument optional X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=35205f19ca9c3aa4e70bd3a233c500ff7b5fa0cf;p=emacs.git Make package-vc-install-from-checkout NAME argument optional * lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout): Allow nil NAME; update documentation. (Bug#66393) --- diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 88304c49675..9780e4d53de 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -953,18 +953,19 @@ for the last released version of the package." (find-file directory))) ;;;###autoload -(defun package-vc-install-from-checkout (dir name) +(defun package-vc-install-from-checkout (dir &optional name) "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. Otherwise infer the package -name from the base name of DIR." - (interactive (let ((dir (read-directory-name "Directory: "))) - (list dir - (if current-prefix-arg - (read-string "Package name: ") - (file-name-base (directory-file-name dir)))))) +for the NAME of the package to set up." + (interactive (let* ((dir (read-directory-name "Directory: ")) + (base (file-name-base (directory-file-name dir)))) + (list dir (and current-prefix-arg + (read-string + (format-prompt "Package name" base) + nil nil base))))) (unless (vc-responsible-backend dir) (user-error "Directory %S is not under version control" dir)) (package-vc--archives-initialize)