emacs - 评估 dir locals 中的值

标签 emacs elisp

我有一个插件系统设置,它将(在编译时)搜索插件目录中的所有插件。

我的问题是我试图允许 Flycheck 将这些插件的 header 添加到包含路径中。

我遇到的问题是我无法弄清楚如何使表达式实际计算其值。 (表达式被视为一个值而不是被计算)

((c++-mode . ((flycheck-clang-include-path . (split-string (substring
                                                            (shell-command-to-string
                                                             (concat "echo src;"
                                                                     "cd /home/czipperz/vick &&"
                                                                     "[ \"$(ls plugins)\" ] &&"
                                                                     "[ \"$(find plugins -name src -type d)\" ] &&"
                                                                     "   find plugins -name src -type d")) 0 -1)
                                                           "\n+")))))

当我打开文件时,出现错误:自动检查语法时出错:(split-string (substring ...) "\n+") of Flycheck-clang-include-path for option "-I "不是字符串列表

最佳答案

eval 伪变量有助于在局部变量配置中进行评估。

例如:

如果您以 eval 形式设置变量,请注意设置缓冲区本地值(作为一般规则,只需使用 setq-在这些情况下,使用 local 而不是 setq)。

关于emacs - 评估 dir locals 中的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33457580/

相关文章:

arrays - 移位/取消移位缓冲区中数组的元素

emacs - ELPA背后的魔力是什么?

emacs23/elisp : how to properly autoload this library?

emacs - 如何测试org-narrow-to-subtree是否生效

emacs - 如何在本地模式中取消设置 map 中的键绑定(bind)?

emacs - Elisp相当于Clojure的时代?

emacs - 在 elisp 中,如何将反引号应用于从文件读取的列表

emacs - 如何使用 emacs 缩进一个 block ?

python - 是否可以使用 emacs 使 Python etags 更智能一些?

Emacs 缩进级别全局覆盖