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

From: Daniel Mendler <[email-masked]>
Date: Fri, 19 Jan 2024 07:52:51 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Stefan Kangas <[email-masked]>
>> Date: Thu, 18 Jan 2024 12:33:31 -0800
>> Cc: [email-masked], [email-masked], [email-masked]
>> 
>> Eli Zaretskii <[email-masked]> writes:
>> 
>> >> +** New package Compat
>> >> +The Compat package on GNU ELPA provides forwards-compatibility
>> >> +support, so that packages that still provide support for older
>> >
>> > I think this is known as "backward compatibility".
>> 
>> AFAIU, backwards-compatibility is about making code written for Emacs 28
>> work without changes on Emacs 29 (N -> N+1).
>> 
>> But forwards-compatibility is about making code written for Emacs 29
>> work without changes on Emacs 28 (N -> N-1).
>> 
>> Compat is doing the latter.
>
> AFAIU, Compat allows Lisp programs written for newer Emacs version to
> work with older Emacs versions.  This makes those Lisp programs
> compatible with old versions of Emacs, and in my book this is
> backwards-compatibility.  But if I'm the only one who thinks that, so
> be it.

That's right. To formulate this differently, Compat allows Lisp programs
written for old Emacs versions to use newer Emacs features. This makes
Compat a forwards-compatibility library for the newer Emacs features.

The difference is what you consider the base line Emacs version. A
package could for example specify `Package-Requires: ((emacs "27.1")
(compat "29.1"))' in its package header. The header means that the
package was written for an old Emacs (27.1) but takes advantage of newer
features (29.1).

However one may also say that the package is actually for 29.1 and
was back-ported via Compat to 27.1. This could indeed have happened if
one looks at the history of the package.

Daniel