Debugging 尝试对属性列表中的函数求值时使用Elisp(无效变量\])

Debugging 尝试对属性列表中的函数求值时使用Elisp(无效变量\]),debugging,emacs,spacemacs,Debugging,Emacs,Spacemacs,在我的Spacemacs配置中,我配置我的组织层来缩放它生成的任何乳胶 (org :variables org-format-latex-options '(:foreground "#90ee90" :background default :scale 2.0 :html-foreground default

在我的Spacemacs配置中,我配置我的组织层来缩放它生成的任何乳胶

(org :variables
      org-format-latex-options '(:foreground "#90ee90" :background default :scale 2.0
                                                :html-foreground default
                                                :html-background "Transparent" :html-scale 1 :matchers
                                                ("begin" "$1" "$" "$$" "\\(" "\\["))

我在多台机器上使用这个配置,我喜欢不同显示器的不同缩放,所以我写了一个小函数

(defun switch-scale ()
  (cond
   ((equal (system-name) "WMachine") 5.0)
   (t 2.0) ;; default
   )
  )
并重写上述代码以调用:scale属性中的函数,如下所示

org-format-latex-options '(:foreground "#90ee90" :background default :scale (switch-scale)
                           ...
当我在暂存缓冲区中测试switch scale时,它工作正常(返回5.0),但当我将其添加到配置中时,在组织模式下尝试生成latex时会触发以下错误

Debugger entered--Lisp error: (void-variable \])
  eval(\] nil)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

我一直在想到底发生了什么,好像(开关量表)没有被评估???

答案是我不了解elisps评估系统。。。因为它在一个带引号的列表中,列表中的所有内容都是文字,所以我实际上需要使用反引号来引用列表,然后使用逗号来计算(switch scale)函数,如下所述