Subject: 27.1; remove-hook doesn't remove entries from hook--depth-alist
From: jakanakaevangeli <[email-masked]>
To: [email-masked]
Date: Wed, 10 Feb 2021 00:56:14 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

add-hook can add an entry to the hook symbol's hook--depth-alist
property and remove-hook doesn't remove it. This means that for each
call to eval-after-load, after-load-functions' hook--depth-alist gets a
new element when the feature is loaded, which can hinder performance.

This can also cause problems if your completing-read-function uses

    (minibuffer-with-setup-hook (:append generated-function-symbol)
      (read-from-minibuffer ...))

This will add a new element to minibuffer-setup-hook's the depth alist
for each completing-read session (such is the case when using
selectrum.el [1] completion function).

[1] https://github.com/raxod502/selectrum/