From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YKjhBnLg/V+1OwAA0tVLHw (envelope-from ) for ; Tue, 12 Jan 2021 17:46:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gHa7AnLg/V9ZcAAAbx9fmQ (envelope-from ) for ; Tue, 12 Jan 2021 17:46:26 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C21A59402AF for ; Tue, 12 Jan 2021 17:46:25 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 43AF92A0DB; Tue, 12 Jan 2021 12:46:07 -0500 (EST) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by mail.notmuchmail.org (Postfix) with ESMTPS id CD4A529E26 for ; Tue, 12 Jan 2021 12:46:02 -0500 (EST) Received: by mail-wr1-x42e.google.com with SMTP id i9so3402080wrc.4 for ; Tue, 12 Jan 2021 09:46:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dF3SJqzo945P9Zt6GZiPjZuh8QxpKlL/3gVM9OPFGd0=; b=vLSB5CZAP7WwgTbsnDlvpwdV1ByPwzRrHLJS8/PtL6gimMDcb435RW5FscJWpBktE9 TolHg5DfyZfLBDXQ/gVXDSMEjfbncei9OfzvXF8z+wdHbln5KJSJ7BdR9XV7XDNvzXwD DRKtmhng4bv49PugvzSR4FAZy1Y/saB98CLj7c3kyvlCA4Cq/ntaE6rvoqULzCP+yf29 QA0VmO00fJzruwyyekV3k2xKq859VM8CtkaHghq68WO1fxnUS39CEsyIGelAjD2PdI3J VHcmZ4zjtA37oCogpyuewFB+eqbgC/vGfbh+yeVPLMiyEHIWfBcQCVyWzKB6H/PYu/tM Wtfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dF3SJqzo945P9Zt6GZiPjZuh8QxpKlL/3gVM9OPFGd0=; b=iYPhur5JSILEEzWc4mK+3ax/WXzgR7889hSrfKz8O6GV0ix/9WFmLXxVqV0KZNdrWh 7IU/IrI+otoyiD3U08KMMF2pe5W68+9nUiJ0pyqvl5b06NRuAs3IZgpROVlAVZ1sy+E3 Zwtj3fbMD3HKNAMjvL9ikavHdJq/p6aWxb6qYF0rmDu6gMOaNZF59cZe8Ohs81V7YRJA 6DCqMi+aC84POTrz6m0T+0N5JXS0jCACDchDQPTWZ6AJf3xl1H+qgm902zpDPsiap8/S pUNTfMUjXeKdQWtkKouVKr+x23JgtLC5j87KL6XRO4KmCy4k68OQNFhrsQq6DyupG7Nn WV9Q== X-Gm-Message-State: AOAM530WZrBTi0egYYah9O5SSHDaoZbx0o2CVNne+wN5b+cVplHptO5L RRxfI/mg6HJdxcy1eDrGV2VexyBnnnb9tP1q X-Google-Smtp-Source: ABdhPJwUYto4Cdwvj3Gpvj/W+g4dXkBdTaZUBwR5Peqn9wd+OTQZBNYlgFrMJV1HKzwJ1Ew4ZMAQoQ== X-Received: by 2002:a05:6000:1542:: with SMTP id 2mr884wry.356.1610473561440; Tue, 12 Jan 2021 09:46:01 -0800 (PST) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [2001:8b0:bb71:7140:64::1]) by smtp.gmail.com with ESMTPSA id h5sm6336930wrp.56.2021.01.12.09.46.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 09:46:00 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id b0b23749; Tue, 12 Jan 2021 17:45:58 +0000 (UTC) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v2 3/3] emacs: Allow functions in notmuch-{tree,unthreaded}-result-format Date: Tue, 12 Jan 2021 17:45:57 +0000 Message-Id: <20210112174557.2229802-4-dme@dme.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112174557.2229802-1-dme@dme.org> References: <20210112174557.2229802-1-dme@dme.org> MIME-Version: 1.0 Message-ID-Hash: 226SNHSMMW434GWNMNFE44TEA7JQBXCM X-Message-ID-Hash: 226SNHSMMW434GWNMNFE44TEA7JQBXCM X-MailFrom: dme@dme.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 CC: David Edmondson X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.08 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=dme-org.20150623.gappssmtp.com header.s=20150623 header.b=vLSB5CZA; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: C21A59402AF X-Spam-Score: -0.08 X-Migadu-Scanner: scn1.migadu.com X-TUID: Qq6cCXo9bnDy 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