[Top][All Lists]

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

Re: Supporting newer Emacs features in older Emacs versions without warn

From: Adam Porter
Subject: Re: Supporting newer Emacs features in older Emacs versions without warnings?
Date: Fri, 24 Sep 2021 17:22:23 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

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

> Can you guys come up with an idea of how to change shortdoc.el so that
> your package can do its job more easily and cleanly?
> [ Ideally without having to use eval-after-load nor having to require
> shortdoc.  ]

Well, I guess we could do something like:

    (declare-function shortdoc-add-function ...)
    (shortdoc-add-function ...))

But that would still produce compilation warnings on pre-shortdoc
Emacsen.  And what if shortdoc isn't loaded yet?  (Is it always loaded
by default, before packages are initialized?)

ISTM that the general problem is how to support newer Emacs features on
older Emacs versions.  If we had some kind of optional-compilation form,
I guess it would help with that (e.g. we can already use (when...) in a
top-level form, but that doesn't prevent compilation of the code, and
`cl-eval-when' only has three choices, not user-defined ones).

So some kind of `compile-when' or `eval-and-compile-when', in which the
user could specify a test form, might be helpful (or maybe that idea's
too crazy, I don't know).

It might also help with supporting optional packages, e.g. in some
packages of mine that support Helm, I have to break out just a few forms
into a separate package to avoid warnings and errors (even a small
mistake can cause errors at init time, which greatly confuse users).
That's not a big deal, but every extra package is more work for
maintainers, and for users (who have to discover that it even exists
before they can use it).

reply via email to

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