How to find a bug in “.emacs” or “init.el”?

后端 未结 5 1669
小蘑菇
小蘑菇 2020-12-12 18:38

Sometimes when I open Emacs, Emacs initialization fail.
That is because .emacs or init.el files have a bug. (My bugs often come from just misty

5条回答
  •  佛祖请我去吃肉
    2020-12-12 18:58

    I've had great success with elisp bug hunter https://github.com/Malabarba/elisp-bug-hunter.

    The most common problems are unmatched parenthesis, loading-failed packages.:

    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.

提交回复
热议问题