elisp 错误“错误类型参数:sequencep, t”是什么意思?意思是?
我正在尝试字节编译 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该错误的含义是,需要
sequence
的函数却收到了t
;该消息告诉您t
不满足谓词sequencep
。例如,尝试评估
(length t)
,您将在*Backtrace*
中看到(假设您将debug-on-error
设置为t
):您看到的消息是由
error-message-string
生成的:The meaning of the error is that a function which expects a
sequence
receivedt
instead; and the message tells you thatt
does not satisfy the predicatesequencep
.E.g., try evaluating
(length t)
and you will see in*Backtrace*
(provided you setdebug-on-error
tot
):The message you see is produced by
error-message-string
:我仍然对这些错误消息感到困惑,但答案是 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
),您应该使用从 匿名 CVSI'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