Subject: bug#58025: [PATCH] Ensure `byte-compile-dest-file-function' is used

From: "Zack Weinberg" <[email-masked]>
Date: Fri, 23 Sep 2022 11:15:57 -0400

On Fri, Sep 23, 2022, at 8:24 AM, [email-masked] wrote:
> The attached `git format-patch` is based on automake v1.16.5 and fixes
> the following warning
>
>      Warning (bytecomp): byte-compile-dest-file is obsolete (as of 23.2);
>      Set byte-compile-dest-file-function instead.
>
> The solution is to ensure bytecomp is loaded which defines
> byte-compile-dest-file-function so it can be used when available,
> and fallback to the original byte-compile-dest-file for earlier
> GNU Emacs and XEmacs.
>
> So far I've tested the result on
>
> * CentOS 7.9 (distro emacs 24.3)
> * OpenBSD 7.1 (custom emacs 28.2)
> * OpenSUSE Leap 15.4 (distro emacs 27.2, xemacs 21.5)

Thank you for the patch.  Are you able to test it with a version of GNU Emacs older than 23.2?  I see that you tested it with XEmacs 21, but as I recall there were quite substantial differences between XEmacs 21 and GNU Emacs of similar vintage.

In addition, if you are able to do the archaeology to report *when bytecomp.el was added to Emacs*, i.e. how far back you have to go before `emacs -l bytecomp` will fail, that would be helpful.  I'm betting it's well before the oldest version we care about, given that bytecomp.el (in 27.1) lists its oldest copyright year as 1985 and <[email-masked]> as the original author, but I'd still like to know for sure.

zw