From 6c6ecf30da3a97c859b693ec09eae1a2ae1502ba Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 1 Sep 2021 02:01:19 +0100 Subject: jao-notmuch: arbitrary functions in notmuch-tree-result-format --- lib/net/jao-notmuch.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/net') diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index b67c788..626eee8 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -196,8 +196,14 @@ (setq mm-text-html-renderer #'jao-w3m-gnus-html-renderer) - -;; Keeping track of unread messages in current tree view +;;;; Using arbitrary functions as "fields" in notmuch-tree-result-format + +(defun jao-notmuch--format-field (fun field fmt msg) + (if (symbolp field) (funcall field msg) (funcall fun field fmt msg))) + +(advice-add 'notmuch-tree-format-field :around #'jao-notmuch--format-field) + +;;;; Keeping track of unread messages in current tree view (defvar-local jao-notmuch--query-name nil) -- cgit v1.2.3