From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uLR1Dqud0mJGbgAAbAwnHQ (envelope-from ) for ; Sat, 16 Jul 2022 13:14:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cBA/Dqud0mLOEQAAauVa8A (envelope-from ) for ; Sat, 16 Jul 2022 13:14:51 +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 A17E29973 for ; Sat, 16 Jul 2022 13:14:50 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 37F276081F; Sat, 16 Jul 2022 11:14:48 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id BB0BC5E53F for ; Sat, 16 Jul 2022 11:14:44 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 4342C5FBD0; Sat, 16 Jul 2022 07:14:43 -0400 (EDT) Received: (nullmailer pid 25384 invoked by uid 1000); Sat, 16 Jul 2022 11:14:41 -0000 From: David Bremner To: Jon Hurst , notmuch@notmuchmail.org Subject: Re: Feature request: show destination in tree view when appropriate In-Reply-To: <87a699e6wn.fsf@hursts.org.uk> References: <87a699e6wn.fsf@hursts.org.uk> Date: Sat, 16 Jul 2022 07:14:41 -0400 Message-ID: <87ilnx5mxq.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: LXMWRDNTLG6T72IEIN4MY4EP3MBC4ZX4 X-Message-ID-Hash: LXMWRDNTLG6T72IEIN4MY4EP3MBC4ZX4 X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header 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=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657970090; 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; bh=7ea5hBKH63msjKoN68yByQ2U2Y+8HlW6lsnC2hjlQwc=; b=qKmMVPcWZ32xuJySmV3UvL0xqfZD7cpEaeZJpJVxNFHUCvt2hl9l2Lu1QVykQKp9Q5l6Qw DVr7dYqMddr1z/FzCjv6/5f7wpTgu1EU3o/SkbQs21Cf5sJO66bJginKcjIKPQvHjEzHxg dWz/dJJqTv4uuXPpCucpkTsbZsWI69rksvFRvuOYfloTskcSdgeTaVHkCRxcdn91Q5wrSc yJOzLXgEOBbANq4luwjlE8bFTCDGSKkED21oHiDXxr9jHLk2dw2hVuj0vY1eIpzj150BZ/ JfxcQiRYuwsNYrP3hKaVx4Qhu9I2k/qHU/8Qt3xIK3CsybFXkowOeyZlmT+KIQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657970090; a=rsa-sha256; cv=none; b=S8NuB6bHVkJLIcUeF/OVJXrMHA0zyIe9wB6/slKuAepNZzdb+pRGzKga72knr4Bmj69Z2q 38SRLJPv9IO7aEx+uXrBvkG9XXuQtOvQaWO+7MtF+g53IK4un91WfBWY9jWNnyFklC5CPX QxQ8x++RjA751FpcUC7i1HO5ZwvgKXtt0Rl9D0K+MKcR7mN/w4u0+SNM0JUCrNqmqD/SEH AVMnYexn3vrBRUB2O0dQ2QV+J3Ev5lDnjgEmAF0f8wtnq/PcnNzjsLiQBKQRdBeeoAYQ2h Z7dSrDk9+k76CiFfbA5zZcIc4tt//sFCJM6g7ls+wbJGQfiKcEMdgtV/EDjPLw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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=none; 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: A17E29973 X-Spam-Score: -2.75 X-Migadu-Scanner: scn0.migadu.com X-TUID: RA0nsYnpj2rD Jon Hurst writes: > Hi, > > In the emacs front end, I can specify authors in the format for search > results and trees. This is great when looking at received mail, but when > looking at sent mail it is not optimal. I have used mutt in the past, > and this puts "To: xxx*xxxx.xxx" in this field for sent mail, which is > much more useful. > > Is there any way to achieve this behaviour with notmuch, and if not, may > I request it as a feature. For notmuch-search-mode, it is achievable by using a function in notmuch-search-result-format. Unfortunately this seems only documented in a commit message, which I append at the end of the message. A similar approach should work for notmuch-tree-result-format. I have not 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. ;; from 4f4ec48df25c8d2963e7124d2781b13e5a7f6a78 If the car of an element in notmuch-search-result-format is a function, insert the result of calling the function into the buffer. This allows a user to generate custom fields in the output of a search result. For example, with: (defun -notmuch-result-flags (format-string result) (let ((tags-to-letters '(("flagged" . "!") ("unread" . "u") ("mine" . "m") ("sent" . "s") ("replied" . "r"))) (tags (plist-get result :tags))) (format format-string (mapconcat (lambda (t2l) (if (member (car t2l) tags) (cdr t2l) " ")) tags-to-letters "")))) (setq notmuch-search-result-format '((-notmuch-result-flags . "%s ") ("date" . "%12s ") ("count" . "%9s ") ("authors" . "%-30s ") ("subject" . "%s ") ("tags" . "(%s)"))) The first few characters on each line of the search result are used to show information about some significant tags associated with the thread.