diff options
| author | Joseph Turner | 2023-10-08 23:29:23 +0200 |
|---|---|---|
| committer | Philip Kaludercic | 2023-10-08 23:29:23 +0200 |
| commit | 35205f19ca9c3aa4e70bd3a233c500ff7b5fa0cf (patch) | |
| tree | 766e9aee69ff08587b8dd54048aca53658b7dd3b | |
| parent | 68318dfd1652151f7d08f7682303499494a0c427 (diff) | |
| download | emacs-35205f19ca9c3aa4e70bd3a233c500ff7b5fa0cf.tar.gz emacs-35205f19ca9c3aa4e70bd3a233c500ff7b5fa0cf.zip | |
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)
| -rw-r--r-- | lisp/emacs-lisp/package-vc.el | 17 |
1 files 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." | |||
| 953 | (find-file directory))) | 953 | (find-file directory))) |
| 954 | 954 | ||
| 955 | ;;;###autoload | 955 | ;;;###autoload |
| 956 | (defun package-vc-install-from-checkout (dir name) | 956 | (defun package-vc-install-from-checkout (dir &optional name) |
| 957 | "Install the package NAME from its source directory DIR. | 957 | "Install the package NAME from its source directory DIR. |
| 958 | NAME defaults to the base name of DIR. | ||
| 958 | Interactively, prompt the user for DIR, which should be a directory | 959 | Interactively, prompt the user for DIR, which should be a directory |
| 959 | under version control, typically one created by `package-vc-checkout'. | 960 | under version control, typically one created by `package-vc-checkout'. |
| 960 | If invoked interactively with a prefix argument, prompt the user | 961 | If invoked interactively with a prefix argument, prompt the user |
| 961 | for the NAME of the package to set up. Otherwise infer the package | 962 | for the NAME of the package to set up." |
| 962 | name from the base name of DIR." | 963 | (interactive (let* ((dir (read-directory-name "Directory: ")) |
| 963 | (interactive (let ((dir (read-directory-name "Directory: "))) | 964 | (base (file-name-base (directory-file-name dir)))) |
| 964 | (list dir | 965 | (list dir (and current-prefix-arg |
| 965 | (if current-prefix-arg | 966 | (read-string |
| 966 | (read-string "Package name: ") | 967 | (format-prompt "Package name" base) |
| 967 | (file-name-base (directory-file-name dir)))))) | 968 | nil nil base))))) |
| 968 | (unless (vc-responsible-backend dir) | 969 | (unless (vc-responsible-backend dir) |
| 969 | (user-error "Directory %S is not under version control" dir)) | 970 | (user-error "Directory %S is not under version control" dir)) |
| 970 | (package-vc--archives-initialize) | 971 | (package-vc--archives-initialize) |