From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iPvSHAV6MmB7UgAA0tVLHw (envelope-from ) for ; Sun, 21 Feb 2021 15:19:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EEmOGAV6MmDVIQAAB5/wlQ (envelope-from ) for ; Sun, 21 Feb 2021 15:19:33 +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) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 10814B4C1 for ; Sun, 21 Feb 2021 16:19:33 +0100 (CET) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 98D5226BF0; Sun, 21 Feb 2021 10:19:16 -0500 (EST) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by mail.notmuchmail.org (Postfix) with ESMTPS id 1EA3C26AD3 for ; Sun, 21 Feb 2021 10:19:09 -0500 (EST) Received: by mail-wr1-x42c.google.com with SMTP id n4so16454099wrx.1 for ; Sun, 21 Feb 2021 07:19:08 -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=Zkeo08UGhYl9PhxIrRJbwlpiCE+K2mkRA+MK3xx/Joc=; b=iC+om4YV8s7DWiAgY/Tfrc4oB0/Tt9aT++jC9IV3w7TtNUu5QCmbKKGmd7RXK9xwzR 1KD/zjdElc8307wAc3VUPOzmCWaLUvdr+SfqDwjGm2GZ96Kx/8Yjc1bEqxkpawfBsD7g +jp8qQivslXFJor51YroiMRWIKE1SvKeLhGvnWnJ3mh5CJPbkP5osmgReTRPSeX4vmSC s3qzQEKJlwSUwTNZvl49AuDK/K0jDO2s3+w66O4PDG3l5BrriCRoT7WUUSrEoDNs7Scu NQHU3vJoa8BhpBQgji079MFQg4aXVRJENSRgj9C+12G2CvApIHfHWFZWYngE088Y+HYv 4d8g== 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=Zkeo08UGhYl9PhxIrRJbwlpiCE+K2mkRA+MK3xx/Joc=; b=XthX5EkUTE/8VfooGl+NXl25IibKRztSpxpcjK2bHQaeA7YJTZN2ZjOeny/iXqXngE JGSeKSjeD06Ww65sYVvLA6zbl4ADewKMlguMYVRh+tPqHUT48hrX2Op9wKBeamDcJfA7 r6JELXFCL3esP0nLZR9dUEf3+utWZMzXpUdD9x/KAZqoh8TIJNfZoyejTG+6aaIL43xf ni+evzwsucHgKNBnqk1PnaxAo7CqJ53yHyjMTVDjJQovlDbR7KEZy+zZLWhBdoTGOnKj pV2sYbpuoeoTIGW+1glzBP2SuZ8p+gUDGmb09cltjkknEUL/5fJhSNjYRu4V7TpnMRit ovFw== X-Gm-Message-State: AOAM5321N8Hz439mEvKqkThIfCKUXYSntJDseFqgd1Jkn66YA6MO8i9F KOEv5xCvOZ41ezVKkKdOEAxMqk6l//RIXQ== X-Google-Smtp-Source: ABdhPJzdNWx5Il73HVNMW84p9AnizmBHsqcggTx1LIPaKXKAa1arGeU7KuVr+0Dr+NLrtt38SmCSsQ== X-Received: by 2002:adf:f205:: with SMTP id p5mr18498955wro.413.1613920745407; Sun, 21 Feb 2021 07:19:05 -0800 (PST) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [81.187.26.238]) by smtp.gmail.com with ESMTPSA id j16sm24644936wra.17.2021.02.21.07.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 07:19:05 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 4a039092; Sun, 21 Feb 2021 15:19:02 +0000 (UTC) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v3 3/3] emacs: Allow functions in notmuch-{tree,unthreaded}-result-format Date: Sun, 21 Feb 2021 15:19:02 +0000 Message-Id: <20210221151902.2301690-4-dme@dme.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210221151902.2301690-1-dme@dme.org> References: <20210221151902.2301690-1-dme@dme.org> MIME-Version: 1.0 Message-ID-Hash: FZ54KN3H5J5SH2DVQSSLXVLXTISIDO22 X-Message-ID-Hash: FZ54KN3H5J5SH2DVQSSLXVLXTISIDO22 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: 1.50 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=dme-org.20150623.gappssmtp.com header.s=20150623 header.b=iC+om4YV; 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: 10814B4C1 X-Spam-Score: 1.50 X-Migadu-Scanner: scn0.migadu.com X-TUID: K8Qap1RUFU1C 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