From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional Date: Sat, 07 Oct 2023 11:40:44 -0700 Message-ID: <87o7haw9zj.fsf@breatheoutbreathe.in> Reply-To: Joseph Turner Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22706"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic (Emacs) To: 66393@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 07 20:43:03 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 1qpCGT-0005bH-Jw for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Oct 2023 20:43:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpCGF-0004Qi-Dw; Sat, 07 Oct 2023 14:42:47 -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 1qpCGB-0004QZ-VE for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 14:42:43 -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 1qpCGB-0004E6-Lj for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 14:42:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qpCGU-0002BY-2h; Sat, 07 Oct 2023 14:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: philipk@posteo.net, bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Oct 2023 18:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66393 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Philip Kaludercic (Emacs) Original-Received: via spool by submit@debbugs.gnu.org id=B.16967041608361 (code B ref -1); Sat, 07 Oct 2023 18:43:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Oct 2023 18:42:40 +0000 Original-Received: from localhost ([127.0.0.1]:55908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpCG8-0002An-Fp for submit@debbugs.gnu.org; Sat, 07 Oct 2023 14:42:40 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:50114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpCG6-0002AW-86 for submit@debbugs.gnu.org; Sat, 07 Oct 2023 14:42:38 -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 1qpCFh-00044O-2g for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 14:42:13 -0400 Original-Received: from out-205.mta0.migadu.com ([91.218.175.205]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpCFe-0004AT-1H for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 14:42:12 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1696704119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=uW01TJ+S6nZ55uJfX/Kupu3KGYiF5RegHM8f8PepJ8A=; b=igxzCwTdXqKxZePAHt5dMMd/sLrmUxyc7lykh1/S16/neWw7mUQ+mgKjkvRwM7cp0I/aH6 YJp6+FQVqOxQ3ozRQNY1jAKr4VLbEkfKBz0EgV63EYw7ZoRTHX7Xtq//K300vjgUgQazKU hum1dS/y95eLnVq86Dg+HoslLguQ86E= X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=91.218.175.205; envelope-from=joseph@breatheoutbreathe.in; helo=out-205.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:272037 Archived-At: --=-=-= Content-Type: text/plain Tags: patch The purpose of this change is to simplify the noninteractive usage of package-vc-install-from-checkout. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Make-package-vc-install-from-checkout-NAME-argument-.patch >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 + (read-string "Package name: "))))) (unless (vc-responsible-backend dir) (user-error "Directory %S is not under version control" dir)) (package-vc--archives-initialize) -- 2.41.0 --=-=-=--