emacs-devel
[Top][All Lists]
Advanced

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

Re: Dealing with obsoletion warnings in non-core code


From: Stefan Monnier
Subject: Re: Dealing with obsoletion warnings in non-core code
Date: Mon, 28 Sep 2020 15:24:36 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> > Ideally I'd like to be able to write the following instead to avoid the
>> > needless repetition:
>> >
>> >     (if (fboundp 'recommended-function)
>> >         (recommended-function)
>> >       (old-but-useful-function))
>> 
>> Indeed, it's a problem of which I'm aware but I don't know how to solve
>> it nicely.
>
> What about something like the below?
>
>   (if (> emacs-major-version NN)
>     (defun recommended-function (...)
>       ...))

I'm not sure I understand what you mean.  You're suggesting to replace
the `fboundp` test above with something like:

    (if (< emacs-major-version NN)
      (defun recommended-function (...)
        ...
        (old-but-useful-function)
        ...))

    [...]

        (recommended-function)

?  If so, I fail to see how it helps.  It will still result in an obsolete
warning on new Emacsen (and adds an "unknown function" warning on old ones).

Or did I misunderstand your suggestion?


        Stefan




reply via email to

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