设置slime-enable-evaluate-in-emacs

Lim*_*och 7 lisp emacs slime

我使用SBCL与粘液,并具有以下代码:

(swank::eval-in-emacs
  '(with-current-buffer (slime-repl-buffer)
     (insert (propertize "foo" 'font-lock-face '(:foreground "red")))))

(print "here is some text")
Run Code Online (Sandbox Code Playgroud)

一般来说,如果我尝试执行带有swank::前缀的任何东西,emacs会给出一个安全错误,这个特殊的告诉我需要设置slime-enable-evaluate-in-emacs为true.这个值在哪里?我一直无法找到粘液或swank配置.&设置文件.非常感谢.

Boz*_*sov 5

您可以简单地将其添加到您的 .emacs 中:

(setq slime-enable-evaluate-in-emacs t)
Run Code Online (Sandbox Code Playgroud)

如果非零,低级 Lisp 可以评估 Emacs 中的任意形式。默认值为 nil,因为此功能可能存在安全风险。