;; Use (startup--witness) instead of nil, so we can detect when the
;; init files set `debug-ignored-errors' to nil.
(if init-file-debug '(startup--witness) debug-ignored-errors))
+ (d-i-e-standard debug-ignored-errors)
;; The init file might contain byte-code with embedded NULs,
;; which can cause problems when read back, so disable nul
;; byte detection. (Bug#52554)
;; If we can tell that the init file altered debug-on-error,
;; arrange to preserve the value that it set up.
- (or (eq debug-ignored-errors d-i-e-initial)
- (setq d-i-e-from-init-file (list debug-ignored-errors)))
+ (unless (eq debug-ignored-errors d-i-e-initial)
+ (if (memq 'startup--witness debug-ignored-errors)
+ ;; The init file wants to add errors to the standard
+ ;; value, so we need to emulate that.
+ (setq d-i-e-from-init-file
+ (list (append d-i-e-standard
+ (remq 'startup--witness
+ debug-ignored-errors))))
+ ;; The init file _replaces_ the standard value.
+ (setq d-i-e-from-init-file (list debug-ignored-errors))))
(or (eq debug-on-error debug-on-error-initial)
(setq debug-on-error-should-be-set t
debug-on-error-from-init-file debug-on-error)))
Each element may be a condition-name or a regexp that matches error messages.
If any element applies to a given error, that error skips the debugger
and just returns to top level.
+If you invoke Emacs with --debug-init, and want to remove some
+elements from the default value of this variable, use `setq' to
+change the value of the variable to a new list, rather than `delq'
+to remove some errors from the list.
This overrides the variable `debug-on-error'.
It does not apply to errors handled by `condition-case'. */);
Vdebug_ignored_errors = Qnil;