aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Gunbin2021-11-11 19:44:27 +0300
committerFilipp Gunbin2021-11-11 19:44:27 +0300
commite30cb92db6b09cffc69c02b8d8b13342d5739af2 (patch)
treeddf9182296856e12260c8669d00aaea1046cdc65
parent2c082ce800db92ffd41381dbd9cc2879b4308ebf (diff)
downloademacs-e30cb92db6b09cffc69c02b8d8b13342d5739af2.tar.gz
emacs-e30cb92db6b09cffc69c02b8d8b13342d5739af2.zip
* lisp/subr.el (add-hook): Fix adding into hook--depth-alist (bug#51620).
-rw-r--r--lisp/subr.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 5a5842d4287..3902251586e 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2042,7 +2042,7 @@ performance impact when running `add-hook' and `remove-hook'."
2042 (when (or (get hook 'hook--depth-alist) (not (zerop depth))) 2042 (when (or (get hook 'hook--depth-alist) (not (zerop depth)))
2043 ;; Note: The main purpose of the above `when' test is to avoid running 2043 ;; Note: The main purpose of the above `when' test is to avoid running
2044 ;; this `setf' before `gv' is loaded during bootstrap. 2044 ;; this `setf' before `gv' is loaded during bootstrap.
2045 (push (cons function depth) (get hook 'hook--depth-alist))) 2045 (setf (alist-get function (get hook 'hook--depth-alist) 0) depth))
2046 (setq hook-value 2046 (setq hook-value
2047 (if (< 0 depth) 2047 (if (< 0 depth)
2048 (append hook-value (list function)) 2048 (append hook-value (list function))