mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-28 05:34:11 +01:00
Make `notmuch-show-clean-address' parsing-error-proof.
Mail-header-parse-address may fail for an invalid address. Before the change, this would result in empty notmuch-show buffer with an error message like: Scan error: "Unbalanced parentheses". The patch wraps the function in condition-case and returns unchanged address in case of error.
This commit is contained in:
parent
79a587d963
commit
d1cbd833a7
1 changed files with 18 additions and 15 deletions
|
@ -224,7 +224,9 @@ same as that of the previous message."
|
|||
")"))))))
|
||||
|
||||
(defun notmuch-show-clean-address (address)
|
||||
"Clean a single email address for display."
|
||||
"Try to clean a single email ADDRESS for display. Return
|
||||
unchanged ADDRESS if parsing fails."
|
||||
(condition-case nil
|
||||
(let* ((parsed (mail-header-parse-address address))
|
||||
(address (car parsed))
|
||||
(name (cdr parsed)))
|
||||
|
@ -239,7 +241,8 @@ same as that of the previous message."
|
|||
|
||||
(if (not name)
|
||||
address
|
||||
(concat name " <" address ">"))))
|
||||
(concat name " <" address ">")))
|
||||
(error address)))
|
||||
|
||||
(defun notmuch-show-insert-headerline (headers date tags depth)
|
||||
"Insert a notmuch style headerline based on HEADERS for a
|
||||
|
|
Loading…
Reference in a new issue