all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: mail@daniel-mendler.de, stefankangas@gmail.com,
	monnier@iro.umontreal.ca, 66554@debbugs.gnu.org
Subject: bug#66554: [PATCH] Add the public API of Compat to the core
Date: Thu, 18 Jan 2024 20:47:38 +0000	[thread overview]
Message-ID: <87wms6jrmd.fsf@posteo.net> (raw)
In-Reply-To: <83v87qwg48.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 18 Jan 2024 22:17:43 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  66554@debbugs.gnu.org,
>>   monnier@iro.umontreal.ca,  stefankangas@gmail.com
>> Date: Thu, 18 Jan 2024 19:51:27 +0000
>> 
>> Pinging this thread with an updated version of the patch:
>
> I find the documentation of this arrangement still insufficient.  The
> way this stuff works (which required Daniel to write 150 lines of
> explanation) is mostly kept out of the written docs, so we'll have to
> rely on people's memory.  Can we document this machinery better?

I can go into more detail, integrating what Daniel explained, my
question just is if this is something that really interests someone
reading the Elisp manual?  One could duplicate or adjust the
documentation for `compat-call' and `compat-function', but explaining
things like how the compat.el file prevents installing Compat
unnecessarily seems like an internal detail to me.

>> +Packages that wish to support older releases of Emacs, without giving
>> +up on newer functionality from recent Emacs releases, one can make use
>> +of the Compat package on GNU ELPA.  For details on how to make use of
>> +the package, @xref{Usage,, Usage, compat, "Compat" Manual}. In case
>                 ^^^^^                                        ^^
> This should be "see @ref" or "@pxref".  @xref is only suitable at the
> beginning of a statement.  And please leave 2 spaces between sentences
> there.

Fixed.

>> +** 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".

My understanding is that "backwards compatibility" would refer to any
measures, that would assist keeping old code working in newer versions
of Emacs.  Compat doesn't do that (let alone the compat.el from this
patch), it just allows older packages to use newer functionality that
can be replicated for older systems.  The term is also used by the
nadvice package on ELPA.

>> +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.
>
> Not sure this detailed description is useful.  Why not just say that
> Compat is now also available with Emacs?

I was not sure how much detail to give, but if you think it is too much,
I can of course remove it.

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> +;;;; Hack 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,
>> +;; 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.
>> +
>> +;; To ensure that if the user is using Emacs X.Y installed, the ELPA
>> +;; package Compat X.Y.Z* (for any values of Z*) does not get
>> +;; unnecessarily installed, as there are no missing features that
>> +;; Compat could provide, we programmatically specify the version of
>> +;; the package to be that of the current Emacs version plus a high
>> +;; "major release" to exceed the major version of Compat.
>> +
>> +;;;###autoload (push (list 'compat emacs-major-version
>> emacs-minor-version most-positive-fixnum) package--builtin-versions)
>
> Hack?  Why call it a hack?
>
> By definition a `compat-NN.MM` package is attempting to provide a subset
> of the API offered by Emacs-NN.MM, so Emacs-NN.MM very much provides
> a version of `compat-NN.MM`.
> IOW
>
>     (push (list 'compat emacs-major-version emacs-minor-version ...)
>           package--builtin-versions)
>
> is not a hack at all.
>
> If you want to label the `most-positive-fixnum` as a hack, I guess
> that's OK but then the comment should clarify what it's referring to.

In this case I just meant "hack" in the sense of a "clever trick", since
it was not immediately obvious to anyone until you brought it up.

> Also, please keep the line below the 80 columns limit, e.g.:
>
>     ;;;###autoload (push (list 'compat emacs-major-version
>     ;;;###autoload              emacs-minor-version most-positive-fixnum)
>     ;;;###autoload       package--builtin-versions)

Sure, done.

>
> -- Stefan





  parent reply	other threads:[~2024-01-18 20:47 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
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 [this message]
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=87wms6jrmd.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=66554@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mail@daniel-mendler.de \
    --cc=monnier@iro.umontreal.ca \
    --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.