emacs: Allow functions in notmuch-{tree,unthreaded}-result-format

If the car of an element in notmuch-tree-result-format or
notmuch-unthreaded-result-format is a function, insert the result of
calling the function into the buffer.
This commit is contained in:
David Edmondson 2021-02-21 15:19:02 +00:00 committed by David Bremner
parent 4f4ec48df2
commit 17bfc25bb3

View file

@ -885,6 +885,9 @@ unchanged ADDRESS if parsing fails."
((listp field) ((listp field)
(format format-string (notmuch-tree-format-field-list field msg))) (format format-string (notmuch-tree-format-field-list field msg)))
((functionp field)
(funcall field format-string msg))
((string-equal field "date") ((string-equal field "date")
(let ((face (if match (let ((face (if match
'notmuch-tree-match-date-face 'notmuch-tree-match-date-face