Fix doom/toggle-debug-mode
Previously this would error due to undefined `doom-debug-on-error` variable. Now behaves like a minor-mode function to toggle both `doom-debug-mode` and `debug-on-error`.
This commit is contained in:
parent
8f98e441c0
commit
f065ddfdaa
1 changed files with 9 additions and 4 deletions
|
@ -363,7 +363,12 @@ If INIT-FILE is non-nil, profile that instead of USER-INIT-FILE."
|
||||||
(advice-add #'esup :override #'doom/profile-emacs)
|
(advice-add #'esup :override #'doom/profile-emacs)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/toggle-debug-mode ()
|
(defun doom/toggle-debug-mode (&optional arg)
|
||||||
"Enable `debug-on-error' and `doom-debug-mode' for verbose logging."
|
"Toggle `debug-on-error' and `doom-debug-mode' for verbose logging."
|
||||||
(interactive)
|
(interactive (list (or current-prefix-arg 'toggle)))
|
||||||
(setq doom-debug-mode doom-debug-on-error))
|
(let ((value
|
||||||
|
(cond ((eq arg 'toggle) (not doom-debug-mode))
|
||||||
|
((> (prefix-numeric-value arg) 0)))))
|
||||||
|
(setq doom-debug-mode value
|
||||||
|
debug-on-error value)
|
||||||
|
(message "Debug mode %s" (if value "on" "off"))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue