From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional Date: Sun, 08 Oct 2023 15:43:37 +0000 Message-ID: <87o7h9ktli.fsf@posteo.net> References: <87o7haw9zj.fsf@breatheoutbreathe.in> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9066"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66393@debbugs.gnu.org To: Joseph Turner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 08 17:45:02 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpVxl-00027Z-4O for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Oct 2023 17:45:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpVxU-0000Vv-4n; Sun, 08 Oct 2023 11:44:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpVxS-0000Vk-IO for bug-gnu-emacs@gnu.org; Sun, 08 Oct 2023 11:44:42 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpVxS-0004EP-As for bug-gnu-emacs@gnu.org; Sun, 08 Oct 2023 11:44:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qpVxm-0004pp-Bg for bug-gnu-emacs@gnu.org; Sun, 08 Oct 2023 11:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Oct 2023 15:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66393 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66393-submit@debbugs.gnu.org id=B66393.169677984818501 (code B ref 66393); Sun, 08 Oct 2023 15:45:02 +0000 Original-Received: (at 66393) by debbugs.gnu.org; 8 Oct 2023 15:44:08 +0000 Original-Received: from localhost ([127.0.0.1]:58265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpVwt-0004oK-OM for submit@debbugs.gnu.org; Sun, 08 Oct 2023 11:44:08 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:33715) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpVwr-0004ne-4z for 66393@debbugs.gnu.org; Sun, 08 Oct 2023 11:44:06 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 10AF0240027 for <66393@debbugs.gnu.org>; Sun, 8 Oct 2023 17:43:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1696779819; bh=5s59eYv+rzay5ihNLZciKtVizpesjqYnYk2aOYgVVbk=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=rG6hJlb2xFcDIuL7Tbivez/r00SCqwxlgwz9R5UK6+xQMHztfaJP9YzgPHqGhVwXK OyqAP6AAtwHA45oZ8UfO+yuG5iHHDeczhJbhOsnTDZhCf2SjN5gTIkd3i+zckjCVK0 mxksEmX2rRqJw0GvvdkQadFSel1sl7/h8ZqVwZ1vG9MGOwYLU9JWStkykurFafvRTF PgsvPLErBz4+mqgCnqPbbbLLXdaP0lbNikuRpEkNV01X4rtrypkBI4cy78QivqWCkD sQbk6yuw18PU4tEDuqJQjsIIq49p20zhvNLBU2DalOM4yso36q9a4DfdLGFQiXUGXh ao82gGSDWfM/g== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S3RK62fdDz9rxF; Sun, 8 Oct 2023 17:43:38 +0200 (CEST) In-Reply-To: <87o7haw9zj.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Sat, 07 Oct 2023 11:40:44 -0700") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272096 Archived-At: Joseph Turner 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 > 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)