core: fix potential undefined function error with transient hooks
Fixes #10930
This commit is contained in:
parent
ba2f692366
commit
a861177c4a
|
@ -53,8 +53,11 @@ If FUNC is a lambda you must give it a name with FNAME. "
|
|||
,(if (functionp hook)
|
||||
`(advice-remove ',hook ',hfunc)
|
||||
`(remove-hook ',hook ',hfunc))
|
||||
(fmakunbound ',hfunc)
|
||||
,(when fname `(fmakunbound ',fname)))))
|
||||
;; instead of unbinding we reset the
|
||||
;; functions to be the `ignore' function.
|
||||
;; see: https://github.com/syl20bnr/spacemacs/issues/10930
|
||||
(fset ',hfunc 'ignore)
|
||||
,(when fname `(fset ',fname 'ignore)))))
|
||||
(if (functionp hook)
|
||||
`((advice-add ',hook :before ',hfunc))
|
||||
`((add-hook ',hook ',hfunc)))))
|
||||
|
|
Loading…
Reference in New Issue