[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#37706: `inhibit-message' affects error backtrace printing in batch m
From: |
Paul Pogonyshev |
Subject: |
bug#37706: `inhibit-message' affects error backtrace printing in batch mode |
Date: |
Fri, 11 Oct 2019 19:17:51 +0200 |
When in batch mode, `debug-on-error' can be used to make Emacs
print backtraces of any errors that occur:
$ emacs --batch --eval "(let ((debug-on-error t)) (error \"...\"))"
Error: (error (error "..."))
(signal error ("..."))
(error "...")
(let ((debug-on-error t)) (error "..."))
(eval (let ((debug-on-error t)) (error "...")) t)
(command-line-1 ("--eval" "(let ((debug-on-error t)) (error \"...\"))"))
(command-line)
(normal-top-level)
...
However, variable `inhibit-message' affects it:
$ emacs --batch --eval "(let ((debug-on-error t) (inhibit-message
t)) (error \"...\"))"
...
This is wrong. When binding `inhibit-message' you have no idea
that an error might happen inside the block. Actually, you
rather hope it doesn't. In other words, when binding
`inhibit-message' you never target error backtraces -- those are
only unwanted side-effects of bugs in your code.
Attached patch makes function `debug' temporarily rebind
`inhibit-message' to nil. The patch is just three lines, but `diff'
got mad because of reindentation.
Paul
0001-Explicitly-bind-inhibit-message-to-nil-in-debug.patch
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#37706: `inhibit-message' affects error backtrace printing in batch mode,
Paul Pogonyshev <=