【问题标题】:What does the elisp error "Wrong type argument: sequencep, t" mean?elisp 错误“错误类型参数:sequencep,t”是什么意思?
【发布时间】:2010-10-14 22:04:13
【问题描述】:

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

【问题讨论】:

    标签: emacs elisp cc-mode


    【解决方案1】:

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

    例如,尝试评估(length t),您将在*Backtrace* 中看到(假设您将debug-on-error 设置为t):

    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"
    

    【讨论】:

      【解决方案2】:

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

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-07-03
        • 1970-01-01
        • 1970-01-01
        • 2020-03-06
        • 1970-01-01
        • 1970-01-01
        • 2021-02-27
        • 1970-01-01
        相关资源
        最近更新 更多