[PATCH v2 3/3] emacs: Allow functions in notmuch-{tree,unthreaded}-result-format

Subject: [PATCH v2 3/3] emacs: Allow functions in notmuch-{tree,unthreaded}-result-format

Date: Tue, 12 Jan 2021 17:45:57 +0000

To: notmuch@notmuchmail.org

Cc: David Edmondson

From: David Edmondson


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.
---
 emacs/notmuch-tree.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index f342f85a..6643bf92 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -849,6 +849,9 @@ unchanged ADDRESS if parsing fails."
      ((listp field)
       (format format-string (notmuch-tree-format-field-list field msg)))
 
+     ((functionp field)
+      (funcall field format-string msg))
+
      ((string-equal field "date")
       (let ((face (if match
 		      'notmuch-tree-match-date-face
-- 
2.29.2
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: