mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
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:
@ -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
|
||||||
|
(let ((sym ,hook-or-function))
|
||||||
(cond ((functionp sym) (advice-remove sym #',fn))
|
(cond ((functionp sym) (advice-remove sym #',fn))
|
||||||
((symbolp sym) (remove-hook 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))
|
||||||
|
Reference in New Issue
Block a user