mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
emacs: Neaten `notmuch-show-insert-bodypart-internal'.
This commit is contained in:
parent
cb4e90e476
commit
742b566cac
1 changed files with 10 additions and 15 deletions
|
@ -848,21 +848,16 @@ will return nil if the CID is unknown or cannot be retrieved."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(defun notmuch-show-insert-bodypart-internal (msg part content-type nth depth button)
|
(defun notmuch-show-insert-bodypart-internal (msg part content-type nth depth button)
|
||||||
(let ((handlers (notmuch-show-handlers-for content-type)))
|
;; Run the handlers until one of them succeeds.
|
||||||
;; Run the content handlers until one of them returns a non-nil
|
(loop for handler in (notmuch-show-handlers-for content-type)
|
||||||
;; value.
|
until (condition-case err
|
||||||
(while (and handlers
|
(funcall handler msg part content-type nth depth button)
|
||||||
(not (condition-case err
|
;; Specifying `debug' here lets the debugger run if
|
||||||
(funcall (car handlers) msg part content-type nth depth button)
|
;; `debug-on-error' is non-nil.
|
||||||
;; Specifying `debug' here lets the debugger
|
((debug error)
|
||||||
;; run if `debug-on-error' is non-nil.
|
(insert "!!! Bodypart handler `" (prin1-to-string handler) "' threw an error:\n"
|
||||||
((debug error)
|
"!!! " (error-message-string err) "\n")
|
||||||
(progn
|
nil))))
|
||||||
(insert "!!! Bodypart insert error: ")
|
|
||||||
(insert (error-message-string err))
|
|
||||||
(insert " !!!\n") nil)))))
|
|
||||||
(setq handlers (cdr handlers))))
|
|
||||||
t)
|
|
||||||
|
|
||||||
(defun notmuch-show-create-part-overlays (button beg end)
|
(defun notmuch-show-create-part-overlays (button beg end)
|
||||||
"Add an overlay to the part between BEG and END"
|
"Add an overlay to the part between BEG and END"
|
||||||
|
|
Loading…
Reference in a new issue