emacs 告诉我“文件模式规范错误"是什么意思? [英] What does it mean when emacs tells me "File mode specification error"?

查看:24
本文介绍了emacs 告诉我“文件模式规范错误"是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我见过的最无用的错误信息.

This is the most useless error message I have ever seen.

我认为它可以翻译为..错误".

I think it translates to .. "error".

来自 *Messages* 缓冲区的完整错误消息是:

The full error message from the *Messages* buffer is:

File mode specification error: (wrong-type-argument characterp "string value here")

我认为该消息的后半部分意味着 emacs 期待一个字符并得到一个字符串.

I think the latter part of that message means that emacs was expecting a character and got a string.

但是当 emacs 告诉我文件模式规范错误"时,我该如何诊断它的含义?以及如何缩小此错误的来源范围?

But how do I go about diagnosing just what it means when emacs tells me "File mode specification error" ? and how do I narrow down where this error is originating?

这两个错误(文件模式错误、期望字符和得到字符串)有什么关系?

How are these two errors (file mode error, expecting character and got string) related?

推荐答案

使用 Mx toggle-debug-on-error RET 删除当这个(或任何)错误发生时进入调试器——假设这是一个正确的错误,而不仅仅是一条消息.这为您提供了堆栈跟踪,因此您可以找出导致它的原因,然后从那里继续(可能使用 edebug,一旦您确定了要检测的函数,但您可以使用常规调试器做很多事情).

Use M-x toggle-debug-on-error RET to drop into the debugger when this (or any) error occurs -- assuming that this is a proper error, and not just a message. That gives you the stack trace, so you can figure out what caused it, and proceed from there (possibly with edebug, once you've determined which function(s) to instrument, but you can do plenty with the regular debugger).

标准调试器命令:M-: (info "(elisp) Debugger Commands") RET

调试lisp(包括edebug)的主要手册入口:M-: (info "(elisp) Debugging") RET

Main manual entry for debugging lisp (including edebug): M-: (info "(elisp) Debugging") RET

仅供参考,rgrep 告诉我 NTEmacs 23.2.1 的 *.el 文件中字符串文件模式规范错误"的唯一实例出现在 normal-mode 函数定义中:
M-x find-function RET normal-mode RET

FYI, rgrep tells me that the only instance of the string "File mode specification error" in the *.el files for NTEmacs 23.2.1 appears in the normal-mode function definition:
M-x find-function RET normal-mode RET

这篇关于emacs 告诉我“文件模式规范错误"是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆