From 5bd1603b652cef4e696f7c0375e8c059c0fc0ece Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 19 Mar 2021 19:06:07 +0800 Subject: [PATCH] [Fix] `dotspacemacs/test-dotfile` complains error on new custom vars After new custom `dotspacemacs-*` variables being introduced in `core/core-dotspacemacs.el`, if one has an old `.spacemacs` without these variables set, `SPC f e R` will complain error messages like ``` Variable: "dotspacemacs-emacs-dumper-dump-file" has value: "nil" that doesn't match its type: "string"... ``` even if these variables have already had initial value. This is because `dotspacemacs||let-init-test` macro only locally declares these variables without setting them with their initial value. This pull request fix this issue by expanding (dotspacemacs/get-variable-list) into `'((var1 value1) (var2 value2) ...)` list instead of `(var1 var2 ...)`. --- core/core-dotspacemacs.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/core-dotspacemacs.el b/core/core-dotspacemacs.el index 49ba396ea..3b59276e2 100644 --- a/core/core-dotspacemacs.el +++ b/core/core-dotspacemacs.el @@ -1106,7 +1106,11 @@ error recovery." (defmacro dotspacemacs||let-init-test (&rest body) "Macro to protect dotspacemacs variables" `(let ((fpath dotspacemacs-filepath) - ,@(dotspacemacs/get-variable-list) + ,@(mapcar (lambda (symbol) + `(,symbol ,(let ((v (symbol-value symbol))) + (if (or (symbolp v) (listp v)) + `',v v)))) + (dotspacemacs/get-variable-list)) (passed-tests 0) (total-tests 0)) (setq dotspacemacs-filepath fpath) (load dotspacemacs-filepath)