Subject: Re: bug#53632: Function definition history

From: Michael Albinus <[email-masked]>
Date: Fri, 04 Feb 2022 18:00:43 +0100

Stefan Monnier <[email-masked]> writes:

Hi Stefan,

> Indeed, the behavior is changed, but AFAICT it's "better" in that it
> gives us a state closer to the one we had before `tramp.el` was loaded:
> the above functions are predefined in `loaddefs.el`
> via `;;;###autoload` cookies, so it's normal that they're defined when
> `tramp` is not loaded.

OK, so be it.

> 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.

> BTW, I notice that the test uses `functionp` so it doesn't pay attention
> to whether macros are properly unloaded (I noticed because I thought it
> was odd that the above list didn't include
> `tramp-archive-autoload-file-name-regexp` which is similarly predefined
> in `loaddefs.el`).

Good point, we shall test also for `macrop'. Will extend the test.

>         Stefan

Best regards, Michael.