GNU bug report logs - #66393
[PATCH] Make package-vc-install-from-checkout NAME argument optional

Previous Next

Package: emacs;

Reported by: Joseph Turner <joseph <at> breatheoutbreathe.in>

Date: Sat, 7 Oct 2023 18:43:01 UTC

Severity: normal

Tags: patch

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Philip Kaludercic <philipk <at> posteo.net>
To: Joseph Turner <joseph <at> breatheoutbreathe.in>
Cc: 66393 <at> debbugs.gnu.org
Subject: bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional
Date: Sun, 08 Oct 2023 15:43:37 +0000
Joseph Turner <joseph <at> breatheoutbreathe.in> writes:

> Tags: patch
>
> The purpose of this change is to simplify the noninteractive usage of package-vc-install-from-checkout.
>
> From cfdd990c6e00decff370e5f224d60862c13be309 Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph <at> breatheoutbreathe.in>
> Date: Sat, 7 Oct 2023 11:38:43 -0700
> Subject: [PATCH] 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.
> ---
>  lisp/emacs-lisp/package-vc.el | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index c7a30736e32..e47deca6d7a 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -841,18 +841,16 @@ 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)
>    "Set up the package NAME in DIR by linking it into the ELPA directory.
> +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."
> +for the NAME of the package to set up."
>    (interactive (let ((dir (read-directory-name "Directory: ")))
> -                 (list dir
> -                       (if current-prefix-arg
> -                           (read-string "Package name: ")
> -                         (file-name-base (directory-file-name dir))))))
> +                 (list dir (when current-prefix-arg

This looks fine, I'm just going to replace the `when' with a `and', ok?

> +                             (read-string "Package name: ")))))
>    (unless (vc-responsible-backend dir)
>      (user-error "Directory %S is not under version control" dir))
>    (package-vc--archives-initialize)




This bug report was last modified 1 year and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.