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

2021-07-30 Thread Andrew Tropin
Hi!  Is this patch already applied?  Can't find it in the repo.

Would be really cool to have an ability to use custom function for
formating mail tree.  For now I have to use and advice and override
notmuch-tree-insert-tree.
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


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

2021-02-21 Thread 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 13007a13..ffb21496 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -866,6 +866,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.30.0
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org