bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66554: [PATCH] Add the public API of Compat to the core


From: Philip Kaludercic
Subject: bug#66554: [PATCH] Add the public API of Compat to the core
Date: Thu, 11 Jan 2024 19:24:09 +0000

Daniel Mendler <mail@daniel-mendler.de> writes:

> Philip Kaludercic <philipk@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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]