Subject: Re: bug#47992: 27; 28; Phase out use of `equal` in `add-hook`, `remove-hook`

From: Olivier Certner <[email-masked]>
Date: Tue, 06 Jul 2021 16:44:56 +0200

Hi,

> > either.  People do `M-x eval-buffer' their .emacs files, and since we're
> > using `equal' here, this happens to work -- almost by accident.
> 
> I understand. This argument is pretty similar to Drew's argument, but
> realistic. The problem is that people expect idempotence when evaluating
> their ".emacs". This property breaks as soon as we require `eq` and if
> we want to retain this behavior we have no alternative than keeping the
> current behavior.

I agree with all this. We should aim for idempotence, as much as practical.

Just wanted to add that there is really no other simple general way out than 
naming lambdas (by whichever mechanism this is done) and matching on names. 
Indeed, even with `equal', and no changes in some lambda's code, idempotence 
is not guaranteed: Just use in the code some macro that calls `gensym'. Each 
evaluation of `lambda' will then raise different functions by `equal', since 
their code differs.

-- 
Olivier Certner