Variables 如何在elisp中正确使用setq?

Variables 如何在elisp中正确使用setq?,variables,emacs,elisp,Variables,Emacs,Elisp,在emacs配置中,我尝试使用以下代码为jedi配置项目根目录: (setq jedi:server-args '("--sys-path" (projectile-project-root))) 它抛出了一个: deferred error : (wrong-type-argument stringp (projectile-project-root)) (我有(错误t上的setq debug),但回溯没有显示任何内容) 如果我像这样硬编码路径,则所有路径都会按预期工作: (setq je

在emacs配置中,我尝试使用以下代码为jedi配置项目根目录:

(setq jedi:server-args '("--sys-path" (projectile-project-root)))
它抛出了一个:

deferred error : (wrong-type-argument stringp (projectile-project-root))
(我有
(错误t上的setq debug)
,但回溯没有显示任何内容)

如果我像这样硬编码路径,则所有路径都会按预期工作:

(setq jedi:server-args '("--sys-path" "/some/path"))
为了给这一行提供一些上下文,下面是相关代码:

(add-hook 'python-mode-hook 'jedi:setup)
(setq debug-on-error t)
(defun jedi-config:setup-server-args ()
  (message (format "Configuring current project dir: %s"
           (projectile-project-root)))
  (setq jedi:server-args '("--sys-path" (projectile-project-root))))

(add-hook 'python-mode-hook
      'jedi-config:setup-server-args)

如何使用射弹变量设置绝地武士的服务器参数?

我终于找到了答案——非常简单:

(setq jedi:server-args (list "--sys-path" (projectile-project-root)))

闻起来像是重复的……我评论中的链接向您展示了如何使用。