我正在尝试使用 emacs 23.1.1 对cc-mode 5.31.3进行字节编译,如下所示:
$ emacs -batch --no-site-file -q -f batch-byte-compile *.el
但是其中两个文件无法编译(除了许多警告):
在 c-init-language-vars-for 中: cc-mode.el:168:10:警告:运行时调用 cl 包中的函数“mapcan” cc-mode.el:168:10:警告:运行时调用 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:警告:运行时调用 cl 包中的函数“mapcan” cc-mode.el:164:53:警告:运行时调用 cl 包中的函数“mapcan” cc-mode.el:165:53:警告:运行时调用的 cl 包中的函数“mapcan” cc-mode.el:165:53:警告:运行时调用的 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 在 c-make-styles-buffer-local 中: cc-styles.el:634:6:Warning: `mapcar' 要求生效;使用“mapc”或“dolist” 反而 cc-styles.el:636:9:Error: 错误的类型参数:sequencep, t
这两个错误是什么意思,我该如何解决?
cc-mode.el 的第 562 行是这样的:
(c-update-modeline)
在哪里c-update-modeline
定义的函数cc-cmds.el
不带参数。此函数的 cc-styles.el 部分的第 636 行:
(defun c-make-styles-buffer-local (&optional this-buf-only-p)
"Make all CC Mode style variables buffer local.
If `this-buf-only-p' is non-nil, the style variables will be made
buffer local only in the current buffer. Otherwise they'll be made
permanently buffer local in any buffer that changes their values.
The buffer localness of the style variables are normally controlled
with the variable `c-style-variables-are-local-p', so there's seldom
any reason to call this function directly."
;; style variables
(let ((func (if this-buf-only-p
'make-local-variable
'make-variable-buffer-local))
(varsyms (cons 'c-indentation-style (copy-alist c-style-variables))))
(delq 'c-special-indent-hook varsyms)
(mapcar func varsyms)
;; Hooks must be handled specially
(if this-buf-only-p ;;;;;;;;; LINE 636 ;;;;;;;;;;;;;;;;;;
(make-local-hook 'c-special-indent-hook)
(make-variable-buffer-local 'c-special-indent-hook)
(setq c-style-variables-are-local-p t))
))
这些错误消息没有意义。我已经使用 emacs 安装了不同版本的 cc-mode 是否会影响这一点?你如何重新编译cc-mode?