all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#47992: 27; 28; Phase out use of `equal` in `add-hook`, `remove-hook`
@ 2021-04-24 12:11 Daniel Mendler
  2021-04-24 20:12 ` bug#47992: [External] : " Drew Adams
  2021-05-02  9:09 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 39+ messages in thread
From: Daniel Mendler @ 2021-04-24 12:11 UTC (permalink / raw)
  To: 47992; +Cc: monnier, jakanakaevangeli

(Follow-up to bug#46326 as suggested by Stefan Monnier)

The functions `add/remove-hook` make use of `equal` to test equality of 
hooks. Using `equal` can lead to excessive memory allocations 
(bug#46326) or hangups (see comment in `set-transient-map`), when large 
closures or cyclic closures are used as hooks.

Right now there are at least three places which have to work around the 
use of `equal` in `add/remove-hook` using a symbol indirection:

* `set-transient-map`
* `minibuffer-with-setup-hook`
* `eval-after-load`

It would be good to change `add/remove-hook` such that it only relies on 
`eq` to test hook equality. Then the symbol indirection workarounds can 
be avoided.

However making such a change directly can lead to subtle breakage. 
Perhaps one could introduce some deprecation behavior first, before 
making the final change to `eq`.  If a hook is added/removed and the 
added/removed object is not found via `eq` but found via `equal`, show a 
deprecation warning?





^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2021-07-08  2:11 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-24 12:11 bug#47992: 27; 28; Phase out use of `equal` in `add-hook`, `remove-hook` Daniel Mendler
2021-04-24 20:12 ` bug#47992: [External] : " Drew Adams
2021-04-24 20:23   ` Daniel Mendler
2021-04-24 21:20     ` Drew Adams
2021-04-24 21:34       ` Daniel Mendler
2021-04-24 22:30   ` Stefan Monnier
2021-04-24 22:38     ` Daniel Mendler
2021-04-24 23:04       ` Stefan Monnier
2021-04-24 23:38         ` Daniel Mendler
2021-04-25  1:16         ` Drew Adams
2021-04-25  3:08           ` Stefan Monnier
2021-04-25  4:57             ` Drew Adams
2021-04-25 13:52               ` Stefan Monnier
2021-04-25  1:16       ` Drew Adams
2021-04-25  1:23     ` Drew Adams
2021-04-25  3:10       ` Stefan Monnier
2021-04-25  4:57         ` Drew Adams
2021-04-25 10:33           ` Daniel Mendler
2021-04-25 13:56           ` Stefan Monnier
2021-05-02  9:09 ` Lars Ingebrigtsen
2021-05-02 10:37   ` Daniel Mendler
2021-05-03  8:50     ` Lars Ingebrigtsen
2021-07-06 14:44     ` Olivier Certner
     [not found]   ` <877di6udfy.fsf@web.de>
2021-07-04  1:09     ` Lars Ingebrigtsen
2021-07-04  2:35       ` Michael Heerdegen
2021-07-04  2:56         ` Lars Ingebrigtsen
2021-07-04  4:28           ` Michael Heerdegen
2021-07-04 13:36             ` Lars Ingebrigtsen
2021-07-04 17:08               ` bug#47992: [External] : " Drew Adams
2021-07-04 22:45                 ` Michael Heerdegen
2021-07-05 12:39                 ` Lars Ingebrigtsen
2021-07-06  1:48             ` Richard Stallman
2021-07-06  2:37               ` bug#47992: [External] : " Drew Adams
2021-07-06  3:21                 ` Michael Heerdegen
2021-07-07 23:57                 ` Richard Stallman
2021-07-06  9:46               ` Arthur Miller
2021-07-07 23:57                 ` Richard Stallman
2021-07-08  2:11                   ` Arthur Miller
2021-07-04 23:15       ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.