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?
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
(add-variable-watcher 'debug-on-error (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) (debug))))
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.