emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e30cb92: * lisp/subr.el (add-hook): Fix adding into hook--depth-a


From: Filipp Gunbin
Subject: master e30cb92: * lisp/subr.el (add-hook): Fix adding into hook--depth-alist (bug#51620).
Date: Thu, 11 Nov 2021 11:45:50 -0500 (EST)

branch: master
commit e30cb92db6b09cffc69c02b8d8b13342d5739af2
Author: Filipp Gunbin <fgunbin@fastmail.fm>
Commit: Filipp Gunbin <fgunbin@fastmail.fm>

    * lisp/subr.el (add-hook): Fix adding into hook--depth-alist (bug#51620).
---
 lisp/subr.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index 5a5842d..3902251 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2042,7 +2042,7 @@ performance impact when running `add-hook' and 
`remove-hook'."
       (when (or (get hook 'hook--depth-alist) (not (zerop depth)))
         ;; Note: The main purpose of the above `when' test is to avoid running
         ;; this `setf' before `gv' is loaded during bootstrap.
-        (push (cons function depth) (get hook 'hook--depth-alist)))
+        (setf (alist-get function (get hook 'hook--depth-alist) 0) depth))
       (setq hook-value
            (if (< 0 depth)
                (append hook-value (list function))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]