all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Philip Kaludercic <philipk@posteo.net>
Cc: 66554@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
	stefankangas@gmail.com, monnier@iro.umontreal.ca
Subject: bug#66554: [PATCH] Add the public API of Compat to the core
Date: Fri, 26 Jan 2024 11:42:30 +0100	[thread overview]
Message-ID: <87a5osfka1.fsf@daniel-mendler.de> (raw)
In-Reply-To: <871qa47ch1.fsf@posteo.net> (Philip Kaludercic's message of "Fri,  26 Jan 2024 07:58:18 +0000")

Philip Kaludercic <philipk@posteo.net> writes:

[...]

>> Philip, do you plan to submit a new version of the patch or do you want
>> me to update the patch with a more extensive explanation? We should keep
>> in mind that the information we add to the Emacs compat.el cannot be
>> self sufficient. Emacs developers who want to use Compat must consult
>> the Compat manual, since that's the place where we document the
>> available compatibility definitions. Therefore referring to the manual
>> for further details should be okay, as long as the general mechanism
>> (and the versioning) is explained sufficiently well in the commentary of
>> the compat.el file in Emacs.
>
> I have tried to update the patch to clarify some of the points in the
> discussion, but feel free to change anything you think ought to be changed:

Thank you, Philip. I added a few comments below, mostly about some
details of the wording. Eli, Stefans, do you think the level of
information provided in the patch is sufficient?

> diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi
> index 6f52a33d194..b9239521d33 100644
> --- a/doc/lispref/package.texi
> +++ b/doc/lispref/package.texi

[...]

> +The versioning of Compat follows that of Emacs, so one can implicitly
> +declare what range of Emacs versions a package supports like so:
> +
> +@example
> +;; Package-Requires: ((emacs "27.2") (compat "29.1"))
> +@end example

The word "range" is misleading. It sounds as if the package supports
27.2 to 29.1, while in it actually supports 27.2 and newer and relies on
some 29.1 APIs.

[...]

> diff --git a/etc/NEWS b/etc/NEWS
> index a1874313502..46859d75aac 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -1321,6 +1321,17 @@ This minor mode generates the tags table automatically based on the
>  current project configuration, and later updates it as you edit the
>  files and save the changes.
>  
> ++++
> +** New package Compat
> +The Compat package on GNU ELPA provides forwards-compatibility
> +support, so that packages that still provide support for older
> +versions of Emacs can still make use of newer definitions that can be
> +reasonably re-implemented in Elisp.  Now a "pseudo" Compat package is
> +part of Emacs, that doesn't provide any compatibility support, but
> +only implements the public-facing API of Compat so that core packages
> +can use Compat, while also preventing the installation of Compat on
> +the most recent version of Emacs.

This NEWS entry explains the addition well, but it is a bit verbose
compared to other entries. I am not fond of the quoted word "pseudo".
Maybe say stub of Compat?

>  * Incompatible Lisp Changes in Emacs 30.1
>  
> diff --git a/lisp/emacs-lisp/compat.el b/lisp/emacs-lisp/compat.el
> new file mode 100644
> index 00000000000..2882974cf2d
> --- /dev/null
> +++ b/lisp/emacs-lisp/compat.el
> @@ -0,0 +1,94 @@
> +;;; compat.el --- Pseudo-Compatibility for Elisp -*- lexical-binding: t; -*-

Instead of "Pseudo" maybe write "Stub of the Emacs Lisp Compatibility
Library"? We could also use "Emacs Lisp Compatibility Library" like in
ELPA Compat package, since for packages using the Compat library it
should not make a difference if the builtin compat.el stub or the ELPA
package is used.

> +;;; Commentary:

[...]

> +;; Note that Compat is NOT a core package and this file is NOT
> +;; available on GNU ELPA.

I find this sentence a bit confusing. What you want to tell here is that
the compat.el file in Emacs differs from the compat.el file in the ELPA
package. This is maybe already clear from the other comments so we can
as well remove this sentence?

[...]

> +;;;; Clever trick to avoid installing Compat if not necessary
> +
> +;; The versioning scheme of the Compat package follows that of Emacs,
> +;; to indicate what version of Emacs is being supported.  For example,
                                                 ^^^^^^^^^

Should we say "supported" here? Compat supports other version than the
one specified. Compat "provides" functionality from that Emacs version.

> +;; the Compat version number 29.2.3.9 would attempt to provide
> +;; compatibility definitions up to Emacs 29.2, while also designating
> +;; that this is the third major release and ninth minor release of
> +;; Compat, for the specific Emacs release.
> +
> +;; The package version of this file is specified programmatically,
> +;; instead of giving a fixed version in the header of this file.  This
> +;; is done to ensure that the version of compat.el provided by Emacs
> +;; is always corresponds to the current version of Emacs.  In addition
      ^^

The "is" should be removed.

> +;; to the major-minor version, a large "major release" makes sure that
> +;; the built-in version of Compat is always preferred over an external
> +;; installation.  This means that if a package specifies a dependency
> +;; on Compat which matches the current version of Emacs that is being
                              ^^^^^^^^^^^^^^^^^^^
                              
...which matches the current *or an older version* of Emacs...

> +;; used, no additional dependencies have to be downloaded.
> +;;
> +;; Further details and background on this file can be found in the
> +;; bug#66554 discussion.
> +
> +;;;###autoload (push (list 'compat
> +;;;###autoload             emacs-major-version
> +;;;###autoload             emacs-minor-version
> +;;;###autoload             1.0e+INF)
> +;;;###autoload       package--builtin-versions)

I prefer if we use 9999 here instead of 1.0e+INF. While infinity is
semantically correct, the float may lead to problems and hurt
readability in the package list.

> +(provide 'compat)
> +;;; compat.el ends here

Daniel





  reply	other threads:[~2024-01-26 10:42 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-15  9:35 bug#66554: [PATCH] Add the public API of Compat to the core Philip Kaludercic
2024-01-10 22:02 ` Stefan Kangas
2024-01-11  5:27   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-11  7:54     ` Philip Kaludercic
2024-01-11  8:06       ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-11 17:35         ` Philip Kaludercic
2024-01-11 17:58           ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-11 19:24             ` Philip Kaludercic
2024-01-11 20:11               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-11 20:24                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-11 20:43                   ` Philip Kaludercic
2024-01-11 21:01                     ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-12 16:29                       ` Philip Kaludercic
2024-01-12 18:05                         ` Eli Zaretskii
2024-01-12 18:17                           ` Philip Kaludercic
2024-01-12 18:29                             ` Eli Zaretskii
2024-01-12 18:40                               ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-12 20:05                                 ` Eli Zaretskii
2024-01-12 22:27                                   ` Philip Kaludercic
2024-01-13  6:44                                     ` Eli Zaretskii
2024-01-13 12:23                                       ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-18 19:51                                         ` Philip Kaludercic
2024-01-18 20:17                                           ` Eli Zaretskii
2024-01-18 20:33                                             ` Stefan Kangas
2024-01-19  6:40                                               ` Eli Zaretskii
2024-01-19  6:52                                                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-18 20:35                                             ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-19  6:43                                               ` Eli Zaretskii
2024-01-19  6:57                                                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-19 16:44                                                 ` Philip Kaludercic
2024-01-19 18:50                                                   ` Eli Zaretskii
2024-01-24  6:23                                                   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-26  7:58                                                     ` Philip Kaludercic
2024-01-26 10:42                                                       ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-01-26 12:35                                                         ` Eli Zaretskii
2024-02-01 15:53                                                           ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-02  8:11                                                         ` Philip Kaludercic
2024-02-02 12:36                                                           ` Eli Zaretskii
2024-02-06 19:10                                                             ` Philip Kaludercic
2024-02-06 19:37                                                               ` Eli Zaretskii
2024-02-06 19:59                                                                 ` Philip Kaludercic
2024-02-07 17:15                                                                   ` Philip Kaludercic
2024-02-07 17:31                                                                     ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-07 17:43                                                                     ` Eli Zaretskii
2024-02-08  7:40                                                                       ` Philip Kaludercic
2024-02-08  8:21                                                                         ` Eli Zaretskii
2024-02-08 10:47                                                                           ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10 16:29                                                                           ` Philip Kaludercic
2024-02-10 16:36                                                                             ` Eli Zaretskii
2024-02-10 16:46                                                                               ` Philip Kaludercic
2024-02-10 17:20                                                                                 ` Eli Zaretskii
2024-02-10 17:40                                                                                   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10 17:47                                                                                     ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10 18:03                                                                                       ` Eli Zaretskii
2024-02-10 18:00                                                                                     ` Eli Zaretskii
2024-02-10 18:14                                                                                       ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10 19:12                                                                                         ` Eli Zaretskii
2024-02-11 21:52                                                                                 ` Philip Kaludercic
2024-01-18 20:47                                             ` Philip Kaludercic
2024-01-19  6:47                                               ` Eli Zaretskii
2024-01-18 20:18                                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-18 20:41                                             ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-18 23:34                                               ` Stefan Kangas
2024-01-19  5:49                                                 ` Philip Kaludercic
2024-01-19  6:42                                                 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-12  8:10                     ` Eli Zaretskii
2024-01-11 20:24                 ` Philip Kaludercic
2024-01-11 20:40                   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-12  7:32                   ` Eli Zaretskii
2024-01-12  7:38                     ` Philip Kaludercic
2024-01-12 11:54                       ` Eli Zaretskii
2024-01-11 10:32   ` Eli Zaretskii
2024-01-11 19:35     ` Stefan Kangas
2024-01-11 20:07       ` Philip Kaludercic
2024-01-12  7:12         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5osfka1.fsf@daniel-mendler.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=66554@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mail@daniel-mendler.de \
    --cc=monnier@iro.umontreal.ca \
    --cc=philipk@posteo.net \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.