all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 66393@debbugs.gnu.org
Cc: Philip Kaludercic (Emacs) <philipk@posteo.net>
Subject: bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional
Date: Sat, 07 Oct 2023 11:40:44 -0700	[thread overview]
Message-ID: <87o7haw9zj.fsf@breatheoutbreathe.in> (raw)

[-- Attachment #1: Type: text/plain, Size: 118 bytes --]

Tags: patch

The purpose of this change is to simplify the noninteractive usage of package-vc-install-from-checkout.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Make-package-vc-install-from-checkout-NAME-argument-.patch --]
[-- Type: text/patch, Size: 1872 bytes --]

From cfdd990c6e00decff370e5f224d60862c13be309 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@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
+                             (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


             reply	other threads:[~2023-10-07 18:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-07 18:40 Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-10-08 15:43 ` bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional Philip Kaludercic
2023-10-08 20:50   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08 21:35 ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7haw9zj.fsf@breatheoutbreathe.in \
    --to=bug-gnu-emacs@gnu.org \
    --cc=66393@debbugs.gnu.org \
    --cc=joseph@breatheoutbreathe.in \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.