GNU bug report logs - #67955
[PATCH] Add use-package-vc-prefer-newest user option

Previous Next

Package: emacs;

Reported by: Tony Zorman <soliditsallgood <at> mailbox.org>

Date: Thu, 21 Dec 2023 18:14:01 UTC

Severity: wishlist

Tags: patch

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67955 in the body.
You can then email your comments to 67955 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#67955; Package emacs. (Thu, 21 Dec 2023 18:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tony Zorman <soliditsallgood <at> mailbox.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 21 Dec 2023 18:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tony Zorman <soliditsallgood <at> mailbox.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add use-package-vc-prefer-newest user option
Date: Thu, 21 Dec 2023 19:13:21 +0100
[Message part 1 (text/plain, inline)]
Hi,

as stated in the subject, the attached patch adds a
'use-package-vc-prefer-newest' user option. When non-nil, packages
installed with use-package's :vc keyword will default to the latest
commit, instead of the latest release.

Thanks
Tony

[0001-Add-use-package-vc-prefer-newest-user-option.patch (text/x-patch, inline)]
From c7271b7f50f7628757bd9d7070a4b4d8a5f05bb4 Mon Sep 17 00:00:00 2001
From: Tony Zorman <soliditsallgood <at> mailbox.org>
Date: Thu, 21 Dec 2023 17:51:09 +0100
Subject: [PATCH] Add use-package-vc-prefer-newest user option

* lisp/use-package/use-package-core.el (use-package-vc-prefer-newest):
User option to prefer the latest commit (as opposed to the latest
release) of a package.
(use-package-normalize--vc-arg): Check for
use-package-vc-prefer-newest.

* doc/misc/use-package.texi (Install package): Document
use-package-vc-prefer-newest.

* etc/NEWS: Document use-package-vc-prefer-newest.
---
 doc/misc/use-package.texi            |  8 ++++++--
 etc/NEWS                             |  5 +++++
 lisp/use-package/use-package-core.el | 17 ++++++++++++++---
 3 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi
index 37ed50ab2b1..ea0504b3deb 100644
--- a/doc/misc/use-package.texi
+++ b/doc/misc/use-package.texi
@@ -1639,8 +1639,12 @@ Install package
 would try -- by invoking @code{package-vc-install} -- to install the
 latest commit of the package @code{foo} from the specified remote.
 
-This can also be used for local packages, by combining it with the
-@code{:load-path} (@pxref{Load path}) keyword:
+@vindex use-package-vc-prefer-newest
+Alternatively, the @code{use-package-vc-prefer-newest} user option
+exists to always prefer the latest commit.
+
+The @code{:vc} keyword can also be used for local packages, by
+combining it with @code{:load-path} (@pxref{Load path}):
 
 @example
 @group
diff --git a/etc/NEWS b/etc/NEWS
index b39dd5f5ab6..100c6b78291 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -971,6 +971,11 @@ interactive Python interpreter specified by 'python-interpreter'.
 *** New ':vc' keyword.
 This keyword enables the user to install packages using 'package-vc'.
 
++++
+*** New user option 'use-package-vc-prefer-newest'.
+This allows the user to always install the newest commit of a package
+when using the ':vc' keyword.
+
 ** Gnus
 
 *** The 'nnweb-type' option 'gmane' has been removed.
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el
index 2897b60b2f9..cb3d73ee284 100644
--- a/lisp/use-package/use-package-core.el
+++ b/lisp/use-package/use-package-core.el
@@ -346,6 +346,15 @@ use-package-compute-statistics
   :type 'boolean
   :group 'use-package)
 
+(defcustom use-package-vc-prefer-newest nil
+  "Prefer the newest commit over the latest release.
+If non-nil, the `:vc' keyword will prefer the latest commit of a
+package instead of the latest stable release.  This has the same
+effect as specifying `:rev :newest' in every invocation of `:vc'."
+  :type 'boolean
+  :version "30.1"
+  :group 'use-package)
+
 (defvar use-package-statistics (make-hash-table))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1649,9 +1658,11 @@ use-package-normalize--vc-arg
                (if (and s (stringp s)) (intern s) s))
              (normalize (k v)
                (pcase k
-                 (:rev (cond ((or (eq v :last-release) (not v)) :last-release)
-                             ((eq v :newest) nil)
-                             (t (ensure-string v))))
+                 (:rev (pcase v
+                         ('nil (if use-package-vc-prefer-newest nil :last-release))
+                         (:last-release :last-release)
+                         (:newest nil)
+                         (_ (ensure-string v))))
                  (:vc-backend (ensure-symbol v))
                  (_ (ensure-string v)))))
     (pcase-let ((valid-kws '(:url :branch :lisp-dir :main-file :vc-backend :rev))
-- 
2.42.0

[Message part 3 (text/plain, inline)]
-- 
Tony Zorman | https://tony-zorman.com/

Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 22 Dec 2023 15:00:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67955; Package emacs. (Thu, 11 Jan 2024 21:02:03 GMT) Full text and rfc822 format available.

Message #10 received at 67955 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Tony Zorman <soliditsallgood <at> mailbox.org>
Cc: Philip Kaludercic <philipk <at> posteo.net>, 67955 <at> debbugs.gnu.org
Subject: Re: bug#67955: [PATCH] Add use-package-vc-prefer-newest user option
Date: Thu, 11 Jan 2024 13:01:23 -0800
Tony Zorman <soliditsallgood <at> mailbox.org> writes:

> Hi,
>
> as stated in the subject, the attached patch adds a
> 'use-package-vc-prefer-newest' user option. When non-nil, packages
> installed with use-package's :vc keyword will default to the latest
> commit, instead of the latest release.

Philip, could you take a look at this patch please?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67955; Package emacs. (Fri, 12 Jan 2024 16:33:01 GMT) Full text and rfc822 format available.

Message #13 received at 67955 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Tony Zorman <soliditsallgood <at> mailbox.org>
Cc: 67955 <at> debbugs.gnu.org
Subject: Re: bug#67955: [PATCH] Add use-package-vc-prefer-newest user option
Date: Fri, 12 Jan 2024 16:32:49 +0000
Tony Zorman <soliditsallgood <at> mailbox.org> writes:

> Hi,
>
> as stated in the subject, the attached patch adds a
> 'use-package-vc-prefer-newest' user option. When non-nil, packages
> installed with use-package's :vc keyword will default to the latest
> commit, instead of the latest release.
>
> Thanks
> Tony
>
>>From c7271b7f50f7628757bd9d7070a4b4d8a5f05bb4 Mon Sep 17 00:00:00 2001
> From: Tony Zorman <soliditsallgood <at> mailbox.org>
> Date: Thu, 21 Dec 2023 17:51:09 +0100
> Subject: [PATCH] Add use-package-vc-prefer-newest user option
>
> * lisp/use-package/use-package-core.el (use-package-vc-prefer-newest):
> User option to prefer the latest commit (as opposed to the latest
> release) of a package.
> (use-package-normalize--vc-arg): Check for
> use-package-vc-prefer-newest.
>
> * doc/misc/use-package.texi (Install package): Document
> use-package-vc-prefer-newest.
>
> * etc/NEWS: Document use-package-vc-prefer-newest.
> ---
>  doc/misc/use-package.texi            |  8 ++++++--
>  etc/NEWS                             |  5 +++++
>  lisp/use-package/use-package-core.el | 17 ++++++++++++++---
>  3 files changed, 25 insertions(+), 5 deletions(-)
>
> diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi
> index 37ed50ab2b1..ea0504b3deb 100644
> --- a/doc/misc/use-package.texi
> +++ b/doc/misc/use-package.texi
> @@ -1639,8 +1639,12 @@ Install package
>  would try -- by invoking @code{package-vc-install} -- to install the
>  latest commit of the package @code{foo} from the specified remote.
>  
> -This can also be used for local packages, by combining it with the
> -@code{:load-path} (@pxref{Load path}) keyword:
> +@vindex use-package-vc-prefer-newest
> +Alternatively, the @code{use-package-vc-prefer-newest} user option
> +exists to always prefer the latest commit.
> +
> +The @code{:vc} keyword can also be used for local packages, by
> +combining it with @code{:load-path} (@pxref{Load path}):
>  
>  @example
>  @group
> diff --git a/etc/NEWS b/etc/NEWS
> index b39dd5f5ab6..100c6b78291 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -971,6 +971,11 @@ interactive Python interpreter specified by 'python-interpreter'.
>  *** New ':vc' keyword.
>  This keyword enables the user to install packages using 'package-vc'.
>  
> ++++
> +*** New user option 'use-package-vc-prefer-newest'.
> +This allows the user to always install the newest commit of a package
> +when using the ':vc' keyword.

I wonder if this should be merged into the previous point, or if it is
even worth mentioning, since it is part of a few feature that has been
added in Emacs 30.

> +
>  ** Gnus
>  
>  *** The 'nnweb-type' option 'gmane' has been removed.
> diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el
> index 2897b60b2f9..cb3d73ee284 100644
> --- a/lisp/use-package/use-package-core.el
> +++ b/lisp/use-package/use-package-core.el
> @@ -346,6 +346,15 @@ use-package-compute-statistics
>    :type 'boolean
>    :group 'use-package)
>  
> +(defcustom use-package-vc-prefer-newest nil
> +  "Prefer the newest commit over the latest release.
> +If non-nil, the `:vc' keyword will prefer the latest commit of a
> +package instead of the latest stable release.  This has the same
> +effect as specifying `:rev :newest' in every invocation of `:vc'."
> +  :type 'boolean
> +  :version "30.1"
> +  :group 'use-package)

I would briefly mention what the issue could be when setting this option
to non-nil, just to give some context as to why it is disabled by default.

> +
>  (defvar use-package-statistics (make-hash-table))
>  
>  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> @@ -1649,9 +1658,11 @@ use-package-normalize--vc-arg
>                 (if (and s (stringp s)) (intern s) s))
>               (normalize (k v)
>                 (pcase k
> -                 (:rev (cond ((or (eq v :last-release) (not v)) :last-release)
> -                             ((eq v :newest) nil)
> -                             (t (ensure-string v))))
> +                 (:rev (pcase v
> +                         ('nil (if use-package-vc-prefer-newest nil :last-release))
> +                         (:last-release :last-release)
> +                         (:newest nil)
> +                         (_ (ensure-string v))))
>                   (:vc-backend (ensure-symbol v))
>                   (_ (ensure-string v)))))
>      (pcase-let ((valid-kws '(:url :branch :lisp-dir :main-file :vc-backend :rev))
> -- 
> 2.42.0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67955; Package emacs. (Sat, 13 Jan 2024 16:52:02 GMT) Full text and rfc822 format available.

Message #16 received at 67955 <at> debbugs.gnu.org (full text, mbox):

From: Tony Zorman <soliditsallgood <at> mailbox.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 67955 <at> debbugs.gnu.org
Subject: Re: bug#67955: [PATCH] Add use-package-vc-prefer-newest user option
Date: Sat, 13 Jan 2024 17:51:44 +0100
On Fri, Jan 12 2024 16:32, Philip Kaludercic wrote:
> Tony Zorman <soliditsallgood <at> mailbox.org> writes:
>> ++++
>> +*** New user option 'use-package-vc-prefer-newest'.
>> +This allows the user to always install the newest commit of a package
>> +when using the ':vc' keyword.
>
> I wonder if this should be merged into the previous point, or if it is
> even worth mentioning, since it is part of a few feature that has been
> added in Emacs 30.

No strong opinions here, I can change this to whatever people prefer.

>> +(defcustom use-package-vc-prefer-newest nil
>> +  "Prefer the newest commit over the latest release.
>> +If non-nil, the `:vc' keyword will prefer the latest commit of a
>> +package instead of the latest stable release.  This has the same
>> +effect as specifying `:rev :newest' in every invocation of `:vc'."
>> +  :type 'boolean
>> +  :version "30.1"
>> +  :group 'use-package)
>
> I would briefly mention what the issue could be when setting this option
> to non-nil, just to give some context as to why it is disabled by default.

Do you mean something like how this goes against what [Non]GNU ELPA do,
and could lead to increased instability (as we are, by definition,
tracking a moving target)? I guess a lot of users will be familiar with
this style of development from MELPA, so I'm not sure any additional
warning here is necessary. Again, I don't feel very strongly about this,
so if you want this changed I'll think of something.

-- 
Tony Zorman | https://tony-zorman.com/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67955; Package emacs. (Mon, 15 Jan 2024 07:10:01 GMT) Full text and rfc822 format available.

Message #19 received at 67955 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Tony Zorman <soliditsallgood <at> mailbox.org>
Cc: 67955 <at> debbugs.gnu.org
Subject: Re: bug#67955: [PATCH] Add use-package-vc-prefer-newest user option
Date: Mon, 15 Jan 2024 07:09:02 +0000
Tony Zorman <soliditsallgood <at> mailbox.org> writes:

> On Fri, Jan 12 2024 16:32, Philip Kaludercic wrote:
>> Tony Zorman <soliditsallgood <at> mailbox.org> writes:
>>> ++++
>>> +*** New user option 'use-package-vc-prefer-newest'.
>>> +This allows the user to always install the newest commit of a package
>>> +when using the ':vc' keyword.
>>
>> I wonder if this should be merged into the previous point, or if it is
>> even worth mentioning, since it is part of a few feature that has been
>> added in Emacs 30.
>
> No strong opinions here, I can change this to whatever people prefer.

Let us leave it then, because I don't know what would be better either.

>>> +(defcustom use-package-vc-prefer-newest nil
>>> +  "Prefer the newest commit over the latest release.
>>> +If non-nil, the `:vc' keyword will prefer the latest commit of a
>>> +package instead of the latest stable release.  This has the same
>>> +effect as specifying `:rev :newest' in every invocation of `:vc'."
>>> +  :type 'boolean
>>> +  :version "30.1"
>>> +  :group 'use-package)
>>
>> I would briefly mention what the issue could be when setting this option
>> to non-nil, just to give some context as to why it is disabled by default.
>
> Do you mean something like how this goes against what [Non]GNU ELPA do,
> and could lead to increased instability (as we are, by definition,
> tracking a moving target)? I guess a lot of users will be familiar with
> this style of development from MELPA, so I'm not sure any additional
> warning here is necessary. Again, I don't feel very strongly about this,
> so if you want this changed I'll think of something.

Yes, that was what I meant.  I don't want to assume that users are
familiar with MELPA, so a brief comment to that effect should suffice.
Thanks!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67955; Package emacs. (Mon, 15 Jan 2024 20:17:02 GMT) Full text and rfc822 format available.

Message #22 received at 67955 <at> debbugs.gnu.org (full text, mbox):

From: Tony Zorman <soliditsallgood <at> mailbox.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 67955 <at> debbugs.gnu.org
Subject: Re: bug#67955: [PATCH] Add use-package-vc-prefer-newest user option
Date: Mon, 15 Jan 2024 21:16:19 +0100
[Message part 1 (text/plain, inline)]
On Mon, Jan 15 2024 07:09, Philip Kaludercic wrote:
> Tony Zorman <soliditsallgood <at> mailbox.org> writes:
>
>> On Fri, Jan 12 2024 16:32, Philip Kaludercic wrote:
>>> Tony Zorman <soliditsallgood <at> mailbox.org> writes:
>>>> ++++
>>>> +*** New user option 'use-package-vc-prefer-newest'.
>>>> +This allows the user to always install the newest commit of a package
>>>> +when using the ':vc' keyword.
>>>
>>> I wonder if this should be merged into the previous point, or if it is
>>> even worth mentioning, since it is part of a few feature that has been
>>> added in Emacs 30.
>>
>> No strong opinions here, I can change this to whatever people prefer.
>
> Let us leave it then, because I don't know what would be better either.
>
>>>> +(defcustom use-package-vc-prefer-newest nil
>>>> +  "Prefer the newest commit over the latest release.
>>>> +If non-nil, the `:vc' keyword will prefer the latest commit of a
>>>> +package instead of the latest stable release.  This has the same
>>>> +effect as specifying `:rev :newest' in every invocation of `:vc'."
>>>> +  :type 'boolean
>>>> +  :version "30.1"
>>>> +  :group 'use-package)
>>>
>>> I would briefly mention what the issue could be when setting this option
>>> to non-nil, just to give some context as to why it is disabled by default.
>>
>> Do you mean something like how this goes against what [Non]GNU ELPA do,
>> and could lead to increased instability (as we are, by definition,
>> tracking a moving target)? I guess a lot of users will be familiar with
>> this style of development from MELPA, so I'm not sure any additional
>> warning here is necessary. Again, I don't feel very strongly about this,
>> so if you want this changed I'll think of something.
>
> Yes, that was what I meant.  I don't want to assume that users are
> familiar with MELPA, so a brief comment to that effect should suffice.
> Thanks!

Okay, I've attached a new version of the patch.

Thanks for the review!
T

[0001-Add-use-package-vc-prefer-newest-user-option.patch (text/x-patch, inline)]
From 8f207a132f669cf2486ecf0e12ade864a9a6912c Mon Sep 17 00:00:00 2001
From: Tony Zorman <soliditsallgood <at> mailbox.org>
Date: Thu, 21 Dec 2023 17:51:09 +0100
Subject: [PATCH] Add use-package-vc-prefer-newest user option

* lisp/use-package/use-package-core.el (use-package-vc-prefer-newest):
User option to prefer the latest commit (as opposed to the latest
release) of a package.
(use-package-normalize--vc-arg): Check for
use-package-vc-prefer-newest.

* doc/misc/use-package.texi (Install package): Document
use-package-vc-prefer-newest.

* etc/NEWS: Document use-package-vc-prefer-newest.
---
 doc/misc/use-package.texi            |  8 ++++++--
 etc/NEWS                             |  5 +++++
 lisp/use-package/use-package-core.el | 22 +++++++++++++++++++---
 3 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi
index d834e1be754..c2b6404b68b 100644
--- a/doc/misc/use-package.texi
+++ b/doc/misc/use-package.texi
@@ -1639,8 +1639,12 @@ Install package
 would try -- by invoking @code{package-vc-install} -- to install the
 latest commit of the package @code{foo} from the specified remote.
 
-This can also be used for local packages, by combining it with the
-@code{:load-path} (@pxref{Load path}) keyword:
+@vindex use-package-vc-prefer-newest
+Alternatively, the @code{use-package-vc-prefer-newest} user option
+exists to always prefer the latest commit.
+
+The @code{:vc} keyword can also be used for local packages, by
+combining it with @code{:load-path} (@pxref{Load path}):
 
 @example
 @group
diff --git a/etc/NEWS b/etc/NEWS
index 03b8c3b517a..f9e01b14f92 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1035,6 +1035,11 @@ interactive Python interpreter specified by 'python-interpreter'.
 *** New ':vc' keyword.
 This keyword enables the user to install packages using 'package-vc'.
 
++++
+*** New user option 'use-package-vc-prefer-newest'.
+This allows the user to always install the newest commit of a package
+when using the ':vc' keyword.
+
 ** Gnus
 
 *** The 'nnweb-type' option 'gmane' has been removed.
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el
index d9343e14839..ba2e93c97e9 100644
--- a/lisp/use-package/use-package-core.el
+++ b/lisp/use-package/use-package-core.el
@@ -346,6 +346,20 @@ use-package-compute-statistics
   :type 'boolean
   :group 'use-package)
 
+(defcustom use-package-vc-prefer-newest nil
+  "Prefer the newest commit over the latest release.
+By default, much like GNU ELPA and NonGNU ELPA, the `:vc' keyword
+tracks the latest stable release of a package.  If this option is
+non-nil, the latest commit is preferred instead.  This has the
+same effect as specifying `:rev :newest' in every invocation of
+`:vc'.
+
+Note that always tracking a package's latest commit might lead to
+stability issues."
+  :type 'boolean
+  :version "30.1"
+  :group 'use-package)
+
 (defvar use-package-statistics (make-hash-table))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1649,9 +1663,11 @@ use-package-normalize--vc-arg
                (if (and s (stringp s)) (intern s) s))
              (normalize (k v)
                (pcase k
-                 (:rev (cond ((or (eq v :last-release) (not v)) :last-release)
-                             ((eq v :newest) nil)
-                             (t (ensure-string v))))
+                 (:rev (pcase v
+                         ('nil (if use-package-vc-prefer-newest nil :last-release))
+                         (:last-release :last-release)
+                         (:newest nil)
+                         (_ (ensure-string v))))
                  (:vc-backend (ensure-symbol v))
                  (_ (ensure-string v)))))
     (pcase-let ((valid-kws '(:url :branch :lisp-dir :main-file :vc-backend :rev))
-- 
2.43.0

[Message part 3 (text/plain, inline)]
-- 
Tony Zorman | https://tony-zorman.com/

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67955; Package emacs. (Tue, 16 Jan 2024 07:34:02 GMT) Full text and rfc822 format available.

Message #25 received at 67955 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Tony Zorman <soliditsallgood <at> mailbox.org>
Cc: Stefan Kangas <stefankangas <at> gmail.com>, 67955 <at> debbugs.gnu.org
Subject: Re: bug#67955: [PATCH] Add use-package-vc-prefer-newest user option
Date: Tue, 16 Jan 2024 07:33:39 +0000
Tony Zorman <soliditsallgood <at> mailbox.org> writes:


[...]

>> Yes, that was what I meant.  I don't want to assume that users are
>> familiar with MELPA, so a brief comment to that effect should suffice.
>> Thanks!
>
> Okay, I've attached a new version of the patch.
>
> Thanks for the review!
> T
>
> From 8f207a132f669cf2486ecf0e12ade864a9a6912c Mon Sep 17 00:00:00 2001
> From: Tony Zorman <soliditsallgood <at> mailbox.org>
> Date: Thu, 21 Dec 2023 17:51:09 +0100
> Subject: [PATCH] Add use-package-vc-prefer-newest user option
>
> * lisp/use-package/use-package-core.el (use-package-vc-prefer-newest):
> User option to prefer the latest commit (as opposed to the latest
> release) of a package.
> (use-package-normalize--vc-arg): Check for
> use-package-vc-prefer-newest.
>
> * doc/misc/use-package.texi (Install package): Document
> use-package-vc-prefer-newest.
>
> * etc/NEWS: Document use-package-vc-prefer-newest.
> ---
>  doc/misc/use-package.texi            |  8 ++++++--
>  etc/NEWS                             |  5 +++++
>  lisp/use-package/use-package-core.el | 22 +++++++++++++++++++---
>  3 files changed, 30 insertions(+), 5 deletions(-)
>
> diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi
> index d834e1be754..c2b6404b68b 100644
> --- a/doc/misc/use-package.texi
> +++ b/doc/misc/use-package.texi
> @@ -1639,8 +1639,12 @@ Install package
>  would try -- by invoking @code{package-vc-install} -- to install the
>  latest commit of the package @code{foo} from the specified remote.
>  
> -This can also be used for local packages, by combining it with the
> -@code{:load-path} (@pxref{Load path}) keyword:
> +@vindex use-package-vc-prefer-newest
> +Alternatively, the @code{use-package-vc-prefer-newest} user option
> +exists to always prefer the latest commit.
> +
> +The @code{:vc} keyword can also be used for local packages, by
> +combining it with @code{:load-path} (@pxref{Load path}):
>  
>  @example
>  @group
> diff --git a/etc/NEWS b/etc/NEWS
> index 03b8c3b517a..f9e01b14f92 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -1035,6 +1035,11 @@ interactive Python interpreter specified by 'python-interpreter'.
>  *** New ':vc' keyword.
>  This keyword enables the user to install packages using 'package-vc'.
>  
> ++++
> +*** New user option 'use-package-vc-prefer-newest'.
> +This allows the user to always install the newest commit of a package
> +when using the ':vc' keyword.
> +
>  ** Gnus
>  
>  *** The 'nnweb-type' option 'gmane' has been removed.
> diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el
> index d9343e14839..ba2e93c97e9 100644
> --- a/lisp/use-package/use-package-core.el
> +++ b/lisp/use-package/use-package-core.el
> @@ -346,6 +346,20 @@ use-package-compute-statistics
>    :type 'boolean
>    :group 'use-package)
>  
> +(defcustom use-package-vc-prefer-newest nil
> +  "Prefer the newest commit over the latest release.
> +By default, much like GNU ELPA and NonGNU ELPA, the `:vc' keyword
> +tracks the latest stable release of a package.  If this option is
> +non-nil, the latest commit is preferred instead.  This has the
> +same effect as specifying `:rev :newest' in every invocation of
> +`:vc'.
> +
> +Note that always tracking a package's latest commit might lead to
> +stability issues."
> +  :type 'boolean
> +  :version "30.1"
> +  :group 'use-package)

Sounds good to me, I think the patch can be merged.  Any objections?

> +
>  (defvar use-package-statistics (make-hash-table))
>  
>  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> @@ -1649,9 +1663,11 @@ use-package-normalize--vc-arg
>                 (if (and s (stringp s)) (intern s) s))
>               (normalize (k v)
>                 (pcase k
> -                 (:rev (cond ((or (eq v :last-release) (not v)) :last-release)
> -                             ((eq v :newest) nil)
> -                             (t (ensure-string v))))
> +                 (:rev (pcase v
> +                         ('nil (if use-package-vc-prefer-newest nil :last-release))
> +                         (:last-release :last-release)
> +                         (:newest nil)
> +                         (_ (ensure-string v))))
>                   (:vc-backend (ensure-symbol v))
>                   (_ (ensure-string v)))))
>      (pcase-let ((valid-kws '(:url :branch :lisp-dir :main-file :vc-backend :rev))
> -- 
> 2.43.0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67955; Package emacs. (Sat, 30 Mar 2024 08:16:01 GMT) Full text and rfc822 format available.

Message #28 received at 67955 <at> debbugs.gnu.org (full text, mbox):

From: Tony Zorman <soliditsallgood <at> mailbox.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: Stefan Kangas <stefankangas <at> gmail.com>, 67955 <at> debbugs.gnu.org
Subject: Re: bug#67955: [PATCH] Add use-package-vc-prefer-newest user option
Date: Sat, 30 Mar 2024 09:15:32 +0100
On Tue, Jan 16 2024 07:33, Philip Kaludercic wrote:
> Tony Zorman <soliditsallgood <at> mailbox.org> writes:
>
>
> [...]
>
>>> Yes, that was what I meant.  I don't want to assume that users are
>>> familiar with MELPA, so a brief comment to that effect should suffice.
>>> Thanks!
>>
>> Okay, I've attached a new version of the patch.
>>
>> Thanks for the review!
>> T
>>
>> From 8f207a132f669cf2486ecf0e12ade864a9a6912c Mon Sep 17 00:00:00 2001
>> From: Tony Zorman <soliditsallgood <at> mailbox.org>
>> Date: Thu, 21 Dec 2023 17:51:09 +0100
>> Subject: [PATCH] Add use-package-vc-prefer-newest user option
>>
>> * lisp/use-package/use-package-core.el (use-package-vc-prefer-newest):
>> User option to prefer the latest commit (as opposed to the latest
>> release) of a package.
>> (use-package-normalize--vc-arg): Check for
>> use-package-vc-prefer-newest.
>>
>> * doc/misc/use-package.texi (Install package): Document
>> use-package-vc-prefer-newest.
>>
>> * etc/NEWS: Document use-package-vc-prefer-newest.
>> ---
>>  doc/misc/use-package.texi            |  8 ++++++--
>>  etc/NEWS                             |  5 +++++
>>  lisp/use-package/use-package-core.el | 22 +++++++++++++++++++---
>>  3 files changed, 30 insertions(+), 5 deletions(-)
>>
>> diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi
>> index d834e1be754..c2b6404b68b 100644
>> --- a/doc/misc/use-package.texi
>> +++ b/doc/misc/use-package.texi
>> @@ -1639,8 +1639,12 @@ Install package
>>  would try -- by invoking @code{package-vc-install} -- to install the
>>  latest commit of the package @code{foo} from the specified remote.
>>  
>> -This can also be used for local packages, by combining it with the
>> -@code{:load-path} (@pxref{Load path}) keyword:
>> +@vindex use-package-vc-prefer-newest
>> +Alternatively, the @code{use-package-vc-prefer-newest} user option
>> +exists to always prefer the latest commit.
>> +
>> +The @code{:vc} keyword can also be used for local packages, by
>> +combining it with @code{:load-path} (@pxref{Load path}):
>>  
>>  @example
>>  @group
>> diff --git a/etc/NEWS b/etc/NEWS
>> index 03b8c3b517a..f9e01b14f92 100644
>> --- a/etc/NEWS
>> +++ b/etc/NEWS
>> @@ -1035,6 +1035,11 @@ interactive Python interpreter specified by 'python-interpreter'.
>>  *** New ':vc' keyword.
>>  This keyword enables the user to install packages using 'package-vc'.
>>  
>> ++++
>> +*** New user option 'use-package-vc-prefer-newest'.
>> +This allows the user to always install the newest commit of a package
>> +when using the ':vc' keyword.
>> +
>>  ** Gnus
>>  
>>  *** The 'nnweb-type' option 'gmane' has been removed.
>> diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el
>> index d9343e14839..ba2e93c97e9 100644
>> --- a/lisp/use-package/use-package-core.el
>> +++ b/lisp/use-package/use-package-core.el
>> @@ -346,6 +346,20 @@ use-package-compute-statistics
>>    :type 'boolean
>>    :group 'use-package)
>>  
>> +(defcustom use-package-vc-prefer-newest nil
>> +  "Prefer the newest commit over the latest release.
>> +By default, much like GNU ELPA and NonGNU ELPA, the `:vc' keyword
>> +tracks the latest stable release of a package.  If this option is
>> +non-nil, the latest commit is preferred instead.  This has the
>> +same effect as specifying `:rev :newest' in every invocation of
>> +`:vc'.
>> +
>> +Note that always tracking a package's latest commit might lead to
>> +stability issues."
>> +  :type 'boolean
>> +  :version "30.1"
>> +  :group 'use-package)
>
> Sounds good to me, I think the patch can be merged.  Any objections?

I guess not? :)

  Tony

-- 
Tony Zorman | https://tony-zorman.com/




Reply sent to Philip Kaludercic <philipk <at> posteo.net>:
You have taken responsibility. (Sat, 30 Mar 2024 13:43:03 GMT) Full text and rfc822 format available.

Notification sent to Tony Zorman <soliditsallgood <at> mailbox.org>:
bug acknowledged by developer. (Sat, 30 Mar 2024 13:43:03 GMT) Full text and rfc822 format available.

Message #33 received at 67955-done <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Tony Zorman <soliditsallgood <at> mailbox.org>
Cc: 67955-done <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#67955: [PATCH] Add use-package-vc-prefer-newest user option
Date: Sat, 30 Mar 2024 13:42:27 +0000
Tony Zorman <soliditsallgood <at> mailbox.org> writes:

> On Tue, Jan 16 2024 07:33, Philip Kaludercic wrote:
>> Tony Zorman <soliditsallgood <at> mailbox.org> writes:
>>
>>
>> [...]
>>
>>>> Yes, that was what I meant.  I don't want to assume that users are
>>>> familiar with MELPA, so a brief comment to that effect should suffice.
>>>> Thanks!
>>>
>>> Okay, I've attached a new version of the patch.
>>>
>>> Thanks for the review!
>>> T
>>>
>>> From 8f207a132f669cf2486ecf0e12ade864a9a6912c Mon Sep 17 00:00:00 2001
>>> From: Tony Zorman <soliditsallgood <at> mailbox.org>
>>> Date: Thu, 21 Dec 2023 17:51:09 +0100
>>> Subject: [PATCH] Add use-package-vc-prefer-newest user option
>>>
>>> * lisp/use-package/use-package-core.el (use-package-vc-prefer-newest):
>>> User option to prefer the latest commit (as opposed to the latest
>>> release) of a package.
>>> (use-package-normalize--vc-arg): Check for
>>> use-package-vc-prefer-newest.
>>>
>>> * doc/misc/use-package.texi (Install package): Document
>>> use-package-vc-prefer-newest.
>>>
>>> * etc/NEWS: Document use-package-vc-prefer-newest.
>>> ---
>>>  doc/misc/use-package.texi            |  8 ++++++--
>>>  etc/NEWS                             |  5 +++++
>>>  lisp/use-package/use-package-core.el | 22 +++++++++++++++++++---
>>>  3 files changed, 30 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi
>>> index d834e1be754..c2b6404b68b 100644
>>> --- a/doc/misc/use-package.texi
>>> +++ b/doc/misc/use-package.texi
>>> @@ -1639,8 +1639,12 @@ Install package
>>>  would try -- by invoking @code{package-vc-install} -- to install the
>>>  latest commit of the package @code{foo} from the specified remote.
>>>  
>>> -This can also be used for local packages, by combining it with the
>>> -@code{:load-path} (@pxref{Load path}) keyword:
>>> +@vindex use-package-vc-prefer-newest
>>> +Alternatively, the @code{use-package-vc-prefer-newest} user option
>>> +exists to always prefer the latest commit.
>>> +
>>> +The @code{:vc} keyword can also be used for local packages, by
>>> +combining it with @code{:load-path} (@pxref{Load path}):
>>>  
>>>  @example
>>>  @group
>>> diff --git a/etc/NEWS b/etc/NEWS
>>> index 03b8c3b517a..f9e01b14f92 100644
>>> --- a/etc/NEWS
>>> +++ b/etc/NEWS
>>> @@ -1035,6 +1035,11 @@ interactive Python interpreter specified by 'python-interpreter'.
>>>  *** New ':vc' keyword.
>>>  This keyword enables the user to install packages using 'package-vc'.
>>>  
>>> ++++
>>> +*** New user option 'use-package-vc-prefer-newest'.
>>> +This allows the user to always install the newest commit of a package
>>> +when using the ':vc' keyword.
>>> +
>>>  ** Gnus
>>>  
>>>  *** The 'nnweb-type' option 'gmane' has been removed.
>>> diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el
>>> index d9343e14839..ba2e93c97e9 100644
>>> --- a/lisp/use-package/use-package-core.el
>>> +++ b/lisp/use-package/use-package-core.el
>>> @@ -346,6 +346,20 @@ use-package-compute-statistics
>>>    :type 'boolean
>>>    :group 'use-package)
>>>  
>>> +(defcustom use-package-vc-prefer-newest nil
>>> +  "Prefer the newest commit over the latest release.
>>> +By default, much like GNU ELPA and NonGNU ELPA, the `:vc' keyword
>>> +tracks the latest stable release of a package.  If this option is
>>> +non-nil, the latest commit is preferred instead.  This has the
>>> +same effect as specifying `:rev :newest' in every invocation of
>>> +`:vc'.
>>> +
>>> +Note that always tracking a package's latest commit might lead to
>>> +stability issues."
>>> +  :type 'boolean
>>> +  :version "30.1"
>>> +  :group 'use-package)
>>
>> Sounds good to me, I think the patch can be merged.  Any objections?
>
> I guess not? :)

OK.  I have pushed the commit, but forgot to modify the commit message
with a reference to this bug report :/ In the future, it would be
helpful if you could add these as well (just a " (Bug#NNNNNN)" at the
end of the message), so that it becomes less probable to forget these
things.

>   Tony

-- 
	Philip Kaludercic on peregrine




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67955; Package emacs. (Sat, 30 Mar 2024 14:28:02 GMT) Full text and rfc822 format available.

Message #36 received at 67955-done <at> debbugs.gnu.org (full text, mbox):

From: Tony Zorman <soliditsallgood <at> mailbox.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 67955-done <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#67955: [PATCH] Add use-package-vc-prefer-newest user option
Date: Sat, 30 Mar 2024 15:27:25 +0100
On Sat, Mar 30 2024 13:42, Philip Kaludercic wrote:
> OK.  I have pushed the commit,

Thank you!

> but forgot to modify the commit message
> with a reference to this bug report :/ In the future, it would be
> helpful if you could add these as well (just a " (Bug#NNNNNN)" at the
> end of the message), so that it becomes less probable to forget these
> things.

Sure, I'll do that in the future.

  Tony

-- 
Tony Zorman | https://tony-zorman.com/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 28 Apr 2024 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 6 days ago.

Previous Next


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