Using :after-load-function in persp-def-buffer-save/load causes error Symbol’s value as variable is void: persp-after-load-function, as what happened in this issue (and doomemacs turned to :load-function to avoid this error).
This bug was introduced in af24502de46eb3b11d14761d2eff44ac7c024a38. In the function perps-def-buffer-save/load, the interpreter won't capture outside local variable persp-after-load-function for quoted expression persp-after-load-lambda in add-hook.
So when the hook is triggered, the interpreter cannot find persp-after-load-function.
This is because Emacs Lisp won't capture outside local variables for quoted expressions (as data), even though lexical-binding was turned on globally. So I wrapped default-load-fun with (eval ... t), in which the second argument means using lexical binding for evaluation.
Using
:after-load-function
inpersp-def-buffer-save/load
causes errorSymbol’s value as variable is void: persp-after-load-function
, as what happened in this issue (and doomemacs turned to:load-function
to avoid this error).This bug was introduced in af24502de46eb3b11d14761d2eff44ac7c024a38. In the function
perps-def-buffer-save/load
, the interpreter won't capture outside local variablepersp-after-load-function
for quoted expressionpersp-after-load-lambda
inadd-hook
.So when the hook is triggered, the interpreter cannot find
persp-after-load-function
.This is because Emacs Lisp won't capture outside local variables for quoted expressions (as data), even though
lexical-binding
was turned on globally. So I wrappeddefault-load-fun
with(eval ... t)
, in which the second argument means using lexical binding for evaluation.