fix(lib): revert add-transient-hook! refactor
a4b5831
removed this let-binding because I expected the function to capture it, which seems to be the case in general, except for #6865. Since add-transient-hook! could conceivably be used in an elisp file with lexical-binding off, I'll take fewer chances and live with a little redundancy. Amend:a4b58311da
Fix: #6865
This commit is contained in:
parent
6eab48641f
commit
ff9602ef75
1 changed files with 3 additions and 2 deletions
|
@ -749,8 +749,9 @@ advised)."
|
||||||
(defun ,fn (&rest _)
|
(defun ,fn (&rest _)
|
||||||
,(format "Transient hook for %S" (doom-unquote hook-or-function))
|
,(format "Transient hook for %S" (doom-unquote hook-or-function))
|
||||||
,@forms
|
,@forms
|
||||||
(cond ((functionp sym) (advice-remove sym #',fn))
|
(let ((sym ,hook-or-function))
|
||||||
((symbolp sym) (remove-hook sym #',fn)))
|
(cond ((functionp sym) (advice-remove sym #',fn))
|
||||||
|
((symbolp sym) (remove-hook sym #',fn))))
|
||||||
(unintern ',fn nil))
|
(unintern ',fn nil))
|
||||||
(cond ((functionp sym)
|
(cond ((functionp sym)
|
||||||
(advice-add ,hook-or-function ,(if append? :after :before) #',fn))
|
(advice-add ,hook-or-function ,(if append? :after :before) #',fn))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue