From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id gMDRH9W70mIYNQEAbAwnHQ (envelope-from ) for ; Sat, 16 Jul 2022 15:23:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gIRkHtW70mLzbAAAG6o9tA (envelope-from ) for ; Sat, 16 Jul 2022 15:23:33 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 E8B6211644 for ; Sat, 16 Jul 2022 15:23:32 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 5D6D86081D; Sat, 16 Jul 2022 13:23:30 +0000 (UTC) Received: from sender4-of-o50.zoho.com (sender4-of-o50.zoho.com [136.143.188.50]) by mail.notmuchmail.org (Postfix) with ESMTPS id A87E25E01E for ; Sat, 16 Jul 2022 13:23:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1657977802; cv=none; d=zohomail.com; s=zohoarc; b=LIK44QRrGaUDIGETnQER545kLtCXszeIwIYgSaJ+i3WT+FnjNYL29RXUsaMo9xQ78MfCsTG1qaAx0ebbmZLLP1wfmh6RdPBGTJH34beqQ/bPBNeDM987F2HOx06qExpy2dFbgqRHy3zgQmYWNqm0V2BGr2xscab/LqXY+8TsDss= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657977802; h=Content-Type:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=EGrJzuwPUAWmbli+BhURHD8XrFNxBAYig5FuRrwcZkw=; b=mQ2uQHG4pFjJKumdspR3BxUpRI5gqcx4PPFPKcOFsG/yqcUwgLMkGMcr6G2n70RFYKeZ/sSvL/ao8qQdWRJ1STRcD6eUWpen/c0QtV1tAPZFOyfjThESLuJWgoPL7HpPNwVSRMXWrOJlJ6W6nhUUOdTWeBx24WaMkeB75r9/9u8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=hursts.org.uk; spf=pass smtp.mailfrom=jon@hursts.org.uk; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1657977802; s=zoho; d=hursts.org.uk; i=jon@hursts.org.uk; h=From:From:To:To:Subject:Subject:In-Reply-To:References:Date:Date:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To:Cc; bh=EGrJzuwPUAWmbli+BhURHD8XrFNxBAYig5FuRrwcZkw=; b=qHpZEIAHezLOVz2Q02brSwXYgEd9uGFbyCVkZiR+yFxJcKx+bSQGf+CMQv7oC3bL q7U/rat2zX9IBhikSR2TBwh8v8QDVS5Ax9ebfpvEyo9ZdXbfTB8dPl0iBqqqDNMS+kJ Txi7pS6Mj4oFJK+f15sEfPZ1qUgvt1Lx6IV7WFGY= Received: from localhost (88-104-151-4.dynamic.dsl.as9105.com [88.104.151.4]) by mx.zohomail.com with SMTPS id 1657977800381912.1532030169417; Sat, 16 Jul 2022 06:23:20 -0700 (PDT) From: Jon Hurst To: David Bremner , notmuch@notmuchmail.org Subject: Re: Feature request: show destination in tree view when appropriate In-Reply-To: <87ilnx5mxq.fsf@tethera.net> References: <87a699e6wn.fsf@hursts.org.uk> <87ilnx5mxq.fsf@tethera.net> Date: Sat, 16 Jul 2022 14:23:17 +0100 Message-ID: <877d4dry2i.fsf@hursts.org.uk> MIME-Version: 1.0 X-ZohoMailClient: External Message-ID-Hash: OHBKK2YSJZLHYQO457MJE2NA7W75TBXQ X-Message-ID-Hash: OHBKK2YSJZLHYQO457MJE2NA7W75TBXQ X-MailFrom: jon@hursts.org.uk 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 X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657977813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ZLDy5atRto6cMHyKr+QR7ot9toOTtZ22Q5bqz3Kq+1Y=; b=hz0KAYOKJ+IpvMypH6SLKC65+0CxuB/BNpXnV9fchbnre27LgQPkQsVx9aFJOS8DOKrlUP qI9xgHcRFCanMrGxXPNqo49A5xDu8ZXkPqgmOSx15qgb9MlgKgw62S/QnUvpzzCZDJGT0U SaCOuf3qIlsSZQyj7tcwkSdBKw4RIb9sjU92pmDr72gRW1qUFfa0oakeyBiIHp/qRylnAK fa2eN5L64V0RjJExXOTDk6sEeIi555kOcXDoYCORkDqCmi7yRUr5v2cptykXsAojzesKbX rfmvovvwciiew7KwXEuO8ypQxaBPack9EavaQn3whgzuPfDRJfNKAtzWKbJXjw== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1657977813; a=rsa-sha256; cv=fail; b=c0G5TtQSr5+M8U6jHJFZxKsxirTVSLxG8WtUvnp4pWicorA8yrnaZdaK0EPh1lFdlz8PPU 5U8tLt1GYC8BEvsRZctcJrZk7nbhkCr+QsrholNgNPQnDNUQcLMXFEAuR6obuDbMAGSFzw VkVN5uMOUat7SlSKUgObZBA98Faf/51k0TzYg9LGD3E3vEWTocXfHIvmv0gA04Y65YIhNk HGgONgTl068Yqdsgl6+l3KeDyO5tIp2UQ6OcSCfbeWu3PB6hxEFkRAQy/iq9PabB9YFRBu hfRf+HbCSB1cBnK+JVh6yzatIWc4MkMv/lQcN3ytyUjCYgxXdFuOl7tLt2WBGQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=hursts.org.uk header.s=zoho header.b=qHpZEIAH; arc=reject ("signature check failed: fail, {[1] = sig:zohomail.com:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 2.75 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=hursts.org.uk header.s=zoho header.b=qHpZEIAH; arc=reject ("signature check failed: fail, {[1] = sig:zohomail.com:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: E8B6211644 X-Spam-Score: 2.75 X-Migadu-Scanner: scn1.migadu.com X-TUID: EqKve9tPqp5A Many thanks David; just what I needed. > tested either, but I suppose you would need to write a function like > author-or-to that decides for each message which of those to insert. For the record: (defun -notmuch-authors-or-to (format-string result) (let* ((headers (plist-get result :headers)) (match (plist-get result :match)) (to (plist-get headers :To)) (author (notmuch-tree-clean-address (plist-get headers :From))) (len (length (format format-string ""))) (face (if match 'notmuch-tree-match-author-face 'notmuch-tree-no-match-author-face))) (if (string= author "Jon Hurst") (setq author (concat "To:" (notmuch-tree-clean-address to)))) (when (> (length author) len) (setq author (substring author 0 len))) (propertize (format format-string author) 'face face))) (setq notmuch-tree-result-format '(("date" . "%12s ") (-notmuch-authors-or-to . "%-25s") ((("tree" . "%s") ("subject" . "%s")) . " %-54s ") ("tags" . "(%s)")))