summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/package-vc.el
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2022-10-12 21:25:54 +0200
committerPhilip Kaludercic <philipk@posteo.net>2022-10-12 21:25:54 +0200
commit73669f73e65a038a6717377cf8308eba9b7ce2af (patch)
tree7b69a6e7979749103b482e28232d5e12f8497883 /lisp/emacs-lisp/package-vc.el
parent0e3b67e3a37c01b71e6b97cd9b16ee28452a9f72 (diff)
downloademacs-73669f73e65a038a6717377cf8308eba9b7ce2af.tar.gz
emacs-73669f73e65a038a6717377cf8308eba9b7ce2af.tar.bz2
emacs-73669f73e65a038a6717377cf8308eba9b7ce2af.zip
Allow specifying a package name for 'package-vc-link-directory'
* lisp/emacs-lisp/package-vc.el (package-vc-link-directory): Add argument NAME
Diffstat (limited to 'lisp/emacs-lisp/package-vc.el')
-rw-r--r--lisp/emacs-lisp/package-vc.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index d513e9a7331..dfa8094e614 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -339,9 +339,16 @@ be requested using REV."
;;;###autoload
(defalias 'package-checkout #'package-vc-install)
-(defun package-vc-link-directory (dir)
- "Install the package in DIR by linking it into the ELPA directory."
- (interactive (list (read-directory-name "Directory: ")))
+(defun package-vc-link-directory (dir name)
+ "Install the package NAME in DIR by linking it into the ELPA directory.
+If invoked interactively with a prefix argument, the user will be
+prompted for the package NAME. Otherwise it will be inferred
+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))))))
(unless (vc-responsible-backend dir)
(user-error "Directory %S is not under version control" dir))
(package--archives-initialize)