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