Whenever I start up emacs, debug-on-error is enabled. I can't figure out why, there's nowhere where I explicitly enable it. Is there any way for me to figure out where it's coming from?

  • 1
    Try M-x rgrep over your config. It's probably happening in some package you've installed. Failing that, do the same in your server's site-lisp directory.
    – phils
    Sep 12, 2022 at 23:49
  • Bisect your init file to find the culprit. Some code you're loading is setting it to non-nil.
    – Drew
    Sep 13, 2022 at 3:56
  • @phils you know what? I found it. I thought I had tried that before but maybe I missed this instance: github.com/emacsmirror/powershell-mode/blob/master/…
    – Emoses
    Sep 15, 2022 at 16:37
  • You could log an upstream bug report for that if there isn't one already. Or try an alternative version. I'm assuming it's this? emacswiki.org/emacs/PowerShell#h5o-2
    – phils
    Sep 15, 2022 at 23:23

1 Answer 1


If your Emacs is launched with --debug-init command line arg, then debug-on-error is set to startup for the duration of the init process, and reset subsequently.

The easiest way to catch the culprit is to do this ....

Go to your Early Init file, and right the top add the following snippet

 (defun someone-is-setting-debug-on-error (symbol newval operation where)
   (when newval
     (message "Some one is setting `debug-on-error' to %S [%S]" newval load-file-name)

and restart emacs.

That way the stacktrace will hopefully give you a clue about what is happening, or confirm your hunch.

Without you telling us what Emacs you are using---spacemacs, doomemacs---etc, it is difficult to guess how your initialization process is setup---whether it loads single file, or loads multiple files etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.