GNU bug report logs - #47992
27; 28; Phase out use of `equal` in `add-hook`, `remove-hook`

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sat, 24 Apr 2021 12:12:01 UTC

Severity: normal

Tags: fixed

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Olivier Certner <olce.emacs <at> certner.fr>
To: larsi <at> gnus.org, 47992 <at> debbugs.gnu.org
Cc: mail <at> daniel-mendler.de, jakanakaevangeli <at> chiru.no, monnier <at> iro.umontreal.ca
Subject: bug#47992: 27; 28; Phase out use of `equal` in `add-hook`, `remove-hook`
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






This bug report was last modified 3 years and 323 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.