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

发布于 2024-09-27 16:34:03 字数 2977 浏览 4 评论 0原文

我正在尝试字节编译 cc-mode 5.31。 3 使用 emacs 23.1.1 如下:

$ emacs -batch --no-site-file -q -f batch-byte-compile *.el

但是其中两个文件无法编译(除了大量警告之外):

In c-init-language-vars-for:
cc-mode.el:168:10:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:168:10:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:162:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:162:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:163:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:163:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:164:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:164:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:165:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:165:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:166:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:166:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:167:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:167:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:562:4:Error: Wrong type argument: sequencep, t

In c-make-styles-buffer-local:
cc-styles.el:634:6:Warning: `mapcar' called for effect; use `mapc' or `dolist'
    instead
cc-styles.el:636:9:Error: Wrong type argument: 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?

I'm trying to byte-compile cc-mode 5.31.3 using emacs 23.1.1 as follows:

$ emacs -batch --no-site-file -q -f batch-byte-compile *.el

But two of the files are failing to compile (in addition to numerous warnings):

In c-init-language-vars-for:
cc-mode.el:168:10:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:168:10:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:162:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:162:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:163:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:163:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:164:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:164:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:165:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:165:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:166:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:166:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:167:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:167:53:Warning: Function `mapcan' from cl package called at runtime
cc-mode.el:562:4:Error: Wrong type argument: sequencep, t

In c-make-styles-buffer-local:
cc-styles.el:634:6:Warning: `mapcar' called for effect; use `mapc' or `dolist'
    instead
cc-styles.el:636:9:Error: Wrong type argument: sequencep, t

What do these two errors mean, and how can I fix them?

Line 562 of cc-mode.el is this:

  (c-update-modeline)

Where c-update-modeline is a function defined in cc-cmds.el that takes no arguments. Line 636 of cc-styles.el part of this function:

(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))
    ))

These error messages don't make sense. Could the fact that I already have a different version of cc-mode installed with emacs be affecting this? How do you recompile cc-mode?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

红颜悴 2024-10-04 16:34:03

该错误的含义是,需要 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"

The meaning of the error is that a function which expects a sequence received t instead; and the message tells you that t does not satisfy the predicate sequencep.

E.g., try evaluating (length t) and you will see in *Backtrace* (provided you set debug-on-error to t):

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

The message you see is produced by error-message-string:

(condition-case e (length t)
  (error (error-message-string e)))
==> "Wrong type argument: sequencep, t"
岁月静好 2024-10-04 16:34:03

我仍然对这些错误消息感到困惑,但答案是 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),您应该使用从 匿名 CVS

I'm still confused about these error messages, but the answer is that cc-mode 5.31.3 is rather old and can't be compiled with emacs 23 (I was trying to compile cc-mode for curiosity's sake). emacs 23 ships with an updated version of cc-mode, version 5.31.7 -- run the interactive command c-version to get the version of cc-mode you're using.

For those who want to recompile cc-mode (and not use the compiled cc-mode.elc that ships with emacs), you should use download the latest version from anonymous CVS

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文