all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional
@ 2023-10-07 18:40 Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-08 15:43 ` Philip Kaludercic
  2023-10-08 21:35 ` Philip Kaludercic
  0 siblings, 2 replies; 4+ messages in thread
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-07 18:40 UTC (permalink / raw)
  To: 66393; +Cc: Philip Kaludercic

[-- 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional
  2023-10-07 18:40 bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-08 15:43 ` 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
  1 sibling, 1 reply; 4+ messages in thread
From: Philip Kaludercic @ 2023-10-08 15:43 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66393

Joseph Turner <joseph@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@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)





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional
  2023-10-08 15:43 ` Philip Kaludercic
@ 2023-10-08 20:50   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 4+ messages in thread
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-08 20:50 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 66393


Philip Kaludercic <philipk@posteo.net> writes:

> Joseph Turner <joseph@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@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?

Sure!

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






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional
  2023-10-07 18:40 bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-08 15:43 ` Philip Kaludercic
@ 2023-10-08 21:35 ` Philip Kaludercic
  1 sibling, 0 replies; 4+ messages in thread
From: Philip Kaludercic @ 2023-10-08 21:35 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66393-done

Joseph Turner <joseph@breatheoutbreathe.in> writes:

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

Thanks, pushed with slight modifications.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-08 21:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-07 18:40 bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08 15:43 ` 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

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.