Change add-transient-hook! to take hook suffix as 2nd arg
By default, transient hooks are defined as doom-transient-hook-N, where N is a counter. This makes debugging them difficult. Now, you may specify an id for the second argument. e.g. (add-transient-hook! 'find-file-hook load-evil (require 'evil)) Will define doom|transient-hook-load-evil, which is easier to debug and remove, if necessary.
This commit is contained in:
parent
af079e5f6f
commit
6b8520d189
|
@ -110,9 +110,12 @@ invoked, then never again.
|
|||
|
||||
HOOK can be a quoted hook or a sharp-quoted function (which will be advised)."
|
||||
(declare (indent 1))
|
||||
(let ((append (eq (car forms) :after))
|
||||
(fn (intern (format "doom-transient-hook-%s" (cl-incf doom--transient-counter)))))
|
||||
`(when ,hook
|
||||
(let ((append (if (eq (car forms) :after) (pop forms)))
|
||||
(fn (intern (format "doom|transient-hook-%s"
|
||||
(if (not (symbolp (car forms)))
|
||||
(cl-incf doom--transient-counter)
|
||||
(pop forms))))))
|
||||
`(progn
|
||||
(fset ',fn
|
||||
(lambda (&rest _)
|
||||
,@forms
|
||||
|
|
Loading…
Reference in New Issue
Block a user