debugging - 如何找到 ".emacs"或 "init.el"中的错误?

标签 debugging emacs initialization elisp config

有时当我打开 Emacs 时,Emacs 初始化失败。
那是因为.emacsinit.el文件有错误。 (我的错误通常来自于输入错误。)

我想找到 .emacs 中的错误或 init.el .有没有办法做到这一点?

最佳答案

我在 elisp bug hunter 上取得了巨大成功 https://github.com/Malabarba/elisp-bug-hunter .

最常见的问题是不匹配的括号,加载失败的包。:

Automated error hunting

If your Emacs init file signals an error during startup, but you don’t know why, simply issue

M-x bug-hunter-init-file RET e

and The Bug Hunter will find it for you. Note that your init.el (or .emacs) must be idempotent for this to work.

Interactive hunt

If Emacs starts up without errors but something is not working as it should, invoke the same command, but choose the interactive option:

M-x bug-hunter-init-file RET i

The Bug Hunter will start a separate Emacs instance several times, and then it will ask you each time whether that instance presented the problem you have. After doing this about 5–12 times, you’ll be given the results.

关于debugging - 如何找到 ".emacs"或 "init.el"中的错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23772890/

相关文章:

swift - 为什么这会 swift 从 Heroku/Parse 返回错误 "Object not found"?

emacs - 用于注册的 Windows 配置

C++ VS 调试器转移行为?

macos - Emacs/OSX 默认字体设置不存在

emacs - 有没有办法将 .emacs 更改应用到所有 emacs 客户端而无需重新启动 emacs 守护进程?

c - C 中变量的垃圾值是如何生成的?

c - 使用 char 初始化结构的函数 - 解释一下我的警告吗?

c# - 通过看似不必要的字符串初始化来提升性能?

android - 看似无用的安卓调试环境

jquery - 我如何防止它向下推?