Subject: bug#53632: Function definition history

From: Stefan Monnier <[email-masked]>
Date: Fri, 04 Feb 2022 12:14:19 -0500

>> So I think the problem is in the test rather than in the unload code.
>> The patch below fixes the test for me.
>
> The patch essential is to list those functions, and to make an
> exception. Will work, yes. However, I fear that this is error-prone:
> Whenever there is another such function with an autoload cookie in the
> future, the test will fail, again.
>
> Perhaps we shall give these functions a symbol property, say
> `tramp-autoload', and test for that property in order to filter out?
> This should be more robust.

Maybe a simpler option is to give them a recognizable name
(e.g. including "preloaded" or "AL" or somesuch in their name)?

In any case, those parts of the test47 are actually testing
loadhist.el rather than Tramp, so I'd recommend you don't worry too much
about those functions.

I'd focus instead on the parts that verify proper functioning of the code
you put in `tramp-unload-hook`.

        Stefan

PS: BTW, why is `tramp-unload-file-name-handlers` preloaded?
It doesn't seem like it can be meaningfully used before Tramp is loaded.