3

我正在尝试使用 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?

4

2 回答 2

5

错误的含义是一个期望sequence接收到的函数t;并且消息告诉您t不满足谓词sequencep

例如,尝试评估(length t),你会看到*Backtrace*(如果你设置debug-on-errort):

Debugger entered--Lisp error: (wrong-type-argument sequencep t)
  length(t)
  eval((length t) nil)

您看到的消息由以下人员生成error-message-string

(condition-case e (length t)
  (error (error-message-string e)))
==> "Wrong type argument: sequencep, t"
于 2013-07-12T23:33:29.860 回答
0

我仍然对这些错误消息感到困惑,但答案是 cc-mode 5.31.3 相当旧,不能用 emacs 23 编译(出于好奇,我试图编译 cc-mode)。emacs 23 附带了 cc-mode 的更新版本,即 5.31.7 版——运行交互式命令c-version以获取您正在使用的 cc-mode 版本。

对于那些想要重新编译 cc-mode(而不是使用cc-mode.elcemacs 附带的编译器)的人,您应该使用从匿名 CVS下载最新版本

于 2010-10-19T04:43:13.110 回答