GNU bug report logs - #66554
[PATCH] Add the public API of Compat to the core

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Sun, 15 Oct 2023 09:37:01 UTC

Severity: wishlist

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


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

From: Philip Kaludercic <philipk <at> posteo.net>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 66554 <at> debbugs.gnu.org, eliz <at> gnu.org, Stefan Kangas <stefankangas <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#66554: [PATCH] Add the public API of Compat to the core
Date: Thu, 11 Jan 2024 19:24:09 +0000
[Message part 1 (text/plain, inline)]
Daniel Mendler <mail <at> daniel-mendler.de> writes:

> Philip Kaludercic <philipk <at> posteo.net> writes:
>>>> If I am not mistaken, all we would have to do is to adjust the version
>>>> number in the patch to the current Emacs version -- and update it
>>>> whenever Emacs is updated.  I have a slight concern that this could be
>>>> easily forgotten, if it isn't hooked into some update scripts.
>>>
>>> Okay, I see. The specified version should probably be something like
>>> 30.1.999 to make sure that packages requiring any Compat 30.1.x version
>>> will not download the ELPA package?
>>
>> Because of 
>>
>>   (version< "30.1" "30.1.1")
>>
>> we can just set it to the actual Emacs version.
>
> No. We want a version larger than any Compat version corresponding to
> the current Emacs version. For example when there is compat-31.1.1.7 on
> ELPA and Magit depends on compat>=31.1 and Magit is installed on an
> Emacs 31.1, Compat should not be installed, since the builtin Compat
> already satisfies the dependency. However if Magit is installed on an
> Emacs 30.2, compat-31.1.1.7 should be installed. This means the internal
> Compat version on Emacs 30.1 should be like 30.1.9999, or another large
> enough version.

My bad I mixed up what we wanted to achieve, in that case we could make
use of `version-regexp-alist' might make this

[Message part 2 (text/plain, inline)]
diff --git a/lisp/subr.el b/lisp/subr.el
index df28989b399..f5de5c3becf 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -6873,9 +6873,9 @@ version-separator
 
 Usually the separator is \".\", but it can be any other string.")
 
-
 (defconst version-regexp-alist
-  '(("^[-._+ ]?snapshot$"                                 . -4)
+  `(("^[-._+ ]?hyper$"                                    . ,most-positive-fixnum)
+    ("^[-._+ ]?snapshot$"                                 . -4)
     ;; treat "1.2.3-20050920" and "1.2-3" as snapshot releases
     ("^[-._+]$"                                           . -4)
     ;; treat "1.2.3-CVS" as snapshot release
[Message part 3 (text/plain, inline)]
so that

  (version< "30.1.hyper" "30.1.0.1") => nil
  (version< "30.1.0.1" "30.1.hyper") => t

>
>>> Is there a place where we could add a warning to make sure that
>>> bumping the version won't be forgotten?
>>
>> I think that admin/admin.el's `set-version' could be used like this:
>>
>>> I don't mind, but it sounds like the details of adding compat.el to
>>> core are not yet clear to all, and are still being discussed.  Also,
>>> it sounds like we would need to modify compat.el for every release or
>>> something? if so, this should be in make-tarball.txt.
>>
>> As mentioned above, I think this could be automated.
>
> I agree, it would be good to automate the version bump, such that it
> cannot be forgotten.
>
>>> It might be also a good idea to mention this in the ELisp manual
>>> somewhere.
>>
>> This being "Compat"?
>
> It makes sense to also mention Compat in the Elisp manual and refer to
> the Compat manual on ELPA. There we already document Compat usage for
> Emacs core packages, which should be updated accordingly
> (https://elpa.gnu.org/packages/doc/compat.html#Usage).

Right, I agree.

> Daniel

This bug report was last modified 1 year and 178 days ago.

Previous Next


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