gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 14:33:08 24 4
gpt4 key购买 nike

有时当我打开 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com