elisp 错误“错误的类型参数:sequencep,t”是什么意思?

Ada*_*eld 3 emacs elisp cc-mode

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

在 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)
Run Code Online (Sandbox Code Playgroud)

其中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))
    ))
Run Code Online (Sandbox Code Playgroud)

这些错误消息没有意义。我已经在 emacs 上安装了不同版本的 cc-mode 是否会影响这一点?你如何重新编译cc模式?

sds*_*sds 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)
Run Code Online (Sandbox Code Playgroud)

您看到的消息是由error-message-string

(condition-case e (length t)
  (error (error-message-string e)))
==> "Wrong type argument: sequencep, t"
Run Code Online (Sandbox Code Playgroud)