我有以下的..dir locals.el:
((c++-mode . ((irony-compile-flags-work-dir . "/home/aparulekar/Developer/GamePlay")
(irony-compile-flags . (list "-Igameplay/src"
"-Iexternal-deps/bullet/include"
"-Iexternal-deps/oggvorbis/include"
"-Iexternal-deps/libpng/include"
"-Iexternal-deps/zlib/include"
"-Iexternal-deps/lua/include"
"-Iexternal-deps/glew/include")))))当我访问该文件夹中的任何文件时,会得到以下错误:
Directory-local variables error: (wrong-type-argument stringp irony-compile-flags)有人能告诉我为什么我不能给目录局部变量分配一个列表吗?
(这是https://github.com/sarcasm/irony-mode的)
编辑- Anton's answer,加上我有一些dir局部不安全变量相关的抑制正在进行。
发布于 2013-02-21 11:52:42
irony-compile-flags被定义为字符串列表(repeat string)的defcustom形式。
在您的.dir-locals.el中,您忘记了您提供的是值,而不是要计算的lisp表达式。因此,list符号是多余的,这就是打破类型检查的原因:您正在将irony-compile-flags设置为以符号list开头的列表。试试这个:
((c++-mode . ((irony-compile-flags-work-dir . "/home/aparulekar/Developer/GamePlay")
(irony-compile-flags . ("-Igameplay/src"
"-Iexternal-deps/bullet/include"
"-Iexternal-deps/oggvorbis/include"
"-Iexternal-deps/libpng/include"
"-Iexternal-deps/zlib/include"
"-Iexternal-deps/lua/include"
"-Iexternal-deps/glew/include")))))https://stackoverflow.com/questions/15001460
复制相似问题