Fix void-variable sym errors
And remove trailing hyphen on anonymous transient hooks.
This commit is contained in:
parent
e9b750cc74
commit
c42600d771
1 changed files with 4 additions and 3 deletions
|
@ -227,13 +227,14 @@ advised)."
|
|||
(let ((append (if (eq (car forms) :after) (pop forms)))
|
||||
(fn (if (symbolp (car forms))
|
||||
(intern (format "doom|transient-hook-%s" (pop forms)))
|
||||
(make-symbol "doom|transient-hook-"))))
|
||||
(make-symbol "doom|transient-hook"))))
|
||||
`(let ((sym ,hook-or-function))
|
||||
(fset ',fn
|
||||
(lambda (&rest _)
|
||||
,@forms
|
||||
(cond ((functionp sym) (advice-remove sym #',fn))
|
||||
((symbolp sym) (remove-hook sym #',fn)))
|
||||
(let ((sym ,hook-or-function))
|
||||
(cond ((functionp sym) (advice-remove sym #',fn))
|
||||
((symbolp sym) (remove-hook sym #',fn))))
|
||||
(unintern ',fn nil)))
|
||||
(cond ((functionp sym)
|
||||
(advice-add ,hook-or-function ,(if append :after :before) #',fn))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue