unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Edmondson <dme@dme.org>
To: notmuch@notmuchmail.org
Cc: David Edmondson <dme@dme.org>
Subject: [PATCH v3 3/3] emacs: Allow functions in notmuch-{tree,unthreaded}-result-format
Date: Sun, 21 Feb 2021 15:19:02 +0000	[thread overview]
Message-ID: <20210221151902.2301690-4-dme@dme.org> (raw)
In-Reply-To: <20210221151902.2301690-1-dme@dme.org>

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

  parent reply	other threads:[~2021-02-21 15:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21 15:18 [PATCH v3 0/3] Allow functions in notmuch-*-result-format David Edmondson
2021-02-21 15:19 ` [PATCH v3 1/3] emacs: Use pcase in notmuch-search-insert-field David Edmondson
2021-02-21 15:19 ` [PATCH v3 2/3] emacs: Allow functions in notmuch-search-result-format David Edmondson
2021-02-22 11:21   ` [PATCH] test/emacs: test for " David Bremner
2021-08-30 19:49     ` [PATCH v2] " David Bremner
2021-02-21 15:19 ` David Edmondson [this message]
2021-06-12 15:44   ` [PATCH v3 3/3] emacs: Allow functions in notmuch-{tree,unthreaded}-result-format Andrew Tropin
2021-08-02 15:39     ` David Bremner
2021-09-09  2:03 ` [PATCH v3 0/3] Allow functions in notmuch-*-result-format David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210221151902.2301690-4-dme@dme.org \
    --to=dme@dme.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).