[PATCH] emacs: Honor debug-on-error for part renderers

Austin Clements amdragon at MIT.EDU
Fri Apr 18 15:57:17 PDT 2014


Previously, even if debug-on-error was non-nil, the debugger would not
trap on part renderer errors.  This made debugging part renderer bugs
frustrating, so let the debugger trap these errors.
---
 emacs/notmuch-show.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f6ca827..df10d4b 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -785,7 +785,10 @@ (defun notmuch-show-insert-bodypart-internal (msg part content-type nth depth bu
     (while (and handlers
 		(not (condition-case err
 			 (funcall (car handlers) msg part content-type nth depth button)
-		       (error (progn
+		       ;; Specifying `debug' here lets the debugger
+		       ;; run if `debug-on-error' is non-nil.
+		       ((debug error)
+			(progn
 				(insert "!!! Bodypart insert error: ")
 				(insert (error-message-string err))
 				(insert " !!!\n") nil)))))
-- 
1.9.1



More information about the notmuch mailing list