emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 35205f19ca9 3/3: Make package-vc-install-from-checkout NAME argum


From: Philip Kaludercic
Subject: master 35205f19ca9 3/3: Make package-vc-install-from-checkout NAME argument optional
Date: Sun, 8 Oct 2023 17:34:11 -0400 (EDT)

branch: master
commit 35205f19ca9c3aa4e70bd3a233c500ff7b5fa0cf
Author: Joseph Turner <joseph@breatheoutbreathe.in>
Commit: Philip Kaludercic <philipk@posteo.net>

    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)
---
 lisp/emacs-lisp/package-vc.el | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]