我正在尝试使用 emacs 23.1.1 对cc-mode 5.31.3进行字节编译,如下所示:
$ emacs -batch --no-site-file -q -f batch-byte-compile *.el
Run Code Online (Sandbox Code Playgroud)
但是其中两个文件无法编译(除了大量警告之外):
在 c-init-language-vars-for 中: cc-mode.el:168:10:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:168:10:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:162:53:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:162:53:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:163:53:Warning: cl 包中的函数 `mapcan' 在运行时调用 cc-mode.el:163:53:Warning: cl 包中的函数 `mapcan' 在运行时调用 cc-mode.el:164:53:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:164:53:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:165:53:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:165:53:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:166:53:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:166:53:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:167:53:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:167:53:Warning: 在运行时调用 cl 包中的函数“mapcan” cc-mode.el:562:4:Error: 错误的类型参数:sequencep, t …
我正在使用cmake-mode,我认为它来自cc-mode(编辑:下面的评论表明这是不正确的).由于某种原因,我的缩进(例如在if()块中)出现为2个空格,即使我的c-basic-offset设置为4.是否有人知道如何控制它?
例如:
if( foo )
set( a "bar" )
endif()
Run Code Online (Sandbox Code Playgroud) 在Emacs中,只有在返回(在cc模式下)后,该行才会缩进.这是正常的吗?可以在更换新线时自动更改为缩进吗?
例如,我如何看待变量There are a number of predefined styles. Take a look at the variable ‘c-style-alist’ to see a list of them.?
对于Emacs CC模式,我试图使用"bsd"样式,但要使所有行默认为缩进,增量为4而不是8.在我的.emacs文件中,我已经放置:
(setq c-default-style "bsd"
c-basic-offset 4)
(setq c-indent-level 4)
Run Code Online (Sandbox Code Playgroud)
但所有行仍然缩进到8个空格.我无法真正找到问题所在.我正在运行GNU Emacs 23.3.1.