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


Message #53 received at 47992 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Drew Adams <drew.adams <at> oracle.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: "jakanakaevangeli <at> chiru.no" <jakanakaevangeli <at> chiru.no>,
 "47992 <at> debbugs.gnu.org" <47992 <at> debbugs.gnu.org>
Subject: Re: [External] : bug#47992: 27; 28; Phase out use of `equal` in
 `add-hook`, `remove-hook`
Date: Sun, 25 Apr 2021 12:33:17 +0200
On 4/25/21 6:57 AM, Drew Adams wrote:
> As for my opinion on the proposed change: I haven't
> seen a good argument for using `eq' instead of `equal'
> to test for equality in `add|remove-hook' (in the code:
> `memq' instead of `member').
> 
> I gave good arguments for continuing to use `equal'.
> Emacs users use the Elisp interpreter interactively,
> and they do use lambda forms with `add|remove-hook',
> even though that's not a great idea.  `eq' doesn't
> cut the mustard at all, for such use.
> 
> Barring a good argument for using `eq', I'm not in
> favor of such a change.  Given a good argument, I
> might change my mind.  Clear enough?

Drew, it seems to you don't read the arguments which have been made and 
just stick to your opinion of "not applying changes".

You argue that `equal` is better since the user can
then add/remove literally written lambdas interactively. We both agree 
that this is not a recommended or reasonable usage of the hook 
functionality.

I argue that `eq` is better if you use `add/remove-hook` in a perfectly 
valid way, adding cyclic/large closures programmatically. This is an 
accepted practice, since we add closures in `minibuffer-with-setup-hook` 
and at other places. Furthermore it is a significantly more important 
use case than the interactive use case you put forward as argument.

Now we can stay with the borked semantics of `add/remove-hook` and 
continue to use `equal` to cater for your example and require all the 
reasonable programmatic usages of `add/remove-hook` to go through the 
totally unnecessary symbol indirection.

I don't see how your argument holds up here.

Daniel




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.