From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SLiEKlR51mJDDgAAbAwnHQ (envelope-from ) for ; Tue, 19 Jul 2022 11:28:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id SKF5KVR51mLN2AAAG6o9tA (envelope-from ) for ; Tue, 19 Jul 2022 11:28:52 +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 700EA1080B for ; Tue, 19 Jul 2022 11:28:52 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 993BC5F421; Tue, 19 Jul 2022 09:22:51 +0000 (UTC) Received: from anarres.sindominio.net (anarres.sindominio.net [88.99.208.38]) by mail.notmuchmail.org (Postfix) with ESMTPS id 2561E5F419 for ; Tue, 19 Jul 2022 09:22:49 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by lesnaus.sindominio.net with ESMTP id 7DAFE362089 for ; Tue, 19 Jul 2022 11:22:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 lesnaus.sindominio.net 7DAFE362089 Received: from anarres.sindominio.net ([127.0.0.1]) by localhost (lesnaus.sindominio.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RQlypRAvyv9h for ; Tue, 19 Jul 2022 11:22:46 +0200 (CEST) Received: by lesnaus.sindominio.net (Postfix, from userid 108) id A1E38362081; Tue, 19 Jul 2022 11:22:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 lesnaus.sindominio.net A1E38362081 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lesnaus.sindominio.net with ESMTPSA id 454AA36207D; Tue, 19 Jul 2022 11:22:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 lesnaus.sindominio.net 454AA36207D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sindominio.net; s=mail; t=1658222564; bh=h2lzxIbPHp6Q0T6AE2/UJBLTi0oQd6QqRKvpROd66ZQ=; h=Date:From:To:Subject:In-Reply-To:References:From; b=DTK4UghMzYgxIgCDo7RbOxDF5O/hMfVaGuQ3qYVb+8ks0hcWjbURejxzSnkJM4tEX 8cotd6wSxqa1XRzWlKn2x7DnQjZpRtEowhWJNBdVaaasCibW2ZB2/CFhBLDwGiwAqz ybmu6bfM55auOUFNA6OSOYD4JhCJSOR+53TuhSWfU8Tj15evPiBVDcuQHe7eSAazo/ 8S/nnO/B9/usnIRGOH4xFyJSp39AwSv/KUO1CJ921XQ4XoZMip004E9E3CQglQq0rf GQP7BQtcJ+T5KMdoJfQgK1cWMWZREv04RrvNVv9LrIDobudNfoVNbc8C7QtLH/4jXv UEGBve4QqBkl87lPZ5UPd96hoNOEU4zW37tBE9fwGN2CeMivMvkorjnwsM6V8CQFph /K5Q3hB/zqXnZzsJh/drEK/7DFjDMIJxfmRZCBTDX/ygERYg8zWzg/jw3HDlE1MtU+ 9nA3ohN4O2smbSjWdUewiD6i04t5KV8r0cOq0Fldm7bHoEzEqcHa6h8FPzQCJDnVte SGR0OB9oC80ql07YQK2XJDv9qIjYVUMrHdExOqZrR9x/P+uWgc14guMaP3in8ShtO5 WjUNtZ07RAo1HkOxUr0jMdRFvr/+n4SaCwaNp/iXpX7wXCSTLxfpSXUZonH09akCBx hUHLPCHjiMh3kKONIuP9S/zk= Mime-Version: 1.0 Date: Tue, 19 Jul 2022 11:22:43 +0200 Message-Id: From: "inwit" To: "Jon Hurst" , "David Bremner" , Subject: Re: Feature request: show destination in tree view when appropriate In-Reply-To: <877d4dry2i.fsf@hursts.org.uk> References: <87a699e6wn.fsf@hursts.org.uk> <87ilnx5mxq.fsf@tethera.net> <877d4dry2i.fsf@hursts.org.uk> Message-ID-Hash: 5QILH63T5TLMGPYV5HRHNZLP3B7B27QR X-Message-ID-Hash: 5QILH63T5TLMGPYV5HRHNZLP3B7B27QR X-MailFrom: inwit@sindominio.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=1658222932; 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=ru0o0AnTS6vGrA5ffHFXhBgfGkwuuQLsX8W31BIy7hM=; b=usYQancFrLmXKydCimpWtyAUM45cxW5rcIVUswREU9xo1R1fQO5mrCBsu1tY7oiKvxrfFV Q7j+1zI3wQfzozZOKEDPcQg41nZBqz2F3acfQIK/M9FLorM+utP4HER5OV+Eq9FJdK4uWM 2+oCPWHIgC8AA81NZ/OG9SjCJ5/tfzKIBpPyjF/tPT9JZ8v+K31tGcyzXTprfNn1R6KWUR bGkDJ3zco9y2+5O/KJevClRLsJgcXqmTXzQJwjeFlyHpQJD5cu4/Hfcjd+5pnBiys8bGVR R2D1Z+5njFOLRzeprW80Z1OiygWojsvRxcjS/YKibvzoaB+YK0TXT5iAqL9o/A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658222932; a=rsa-sha256; cv=none; b=sbDAZLSAnQWhAdv0bRgAi+iGQg8icMKaOw1/yWi/tR0hTe7ue7MVaqagqUt1u19FJ1ExRK 5eFbViSs/G3x7Zrb7Up+mnUIXYoJxXYfY9SZTZnvc3pHwUa8XSU08hu0FraU+IoZc1vLrh JjHOKuN0Uq5OxGD1oiBiYLslMTDUrZf5Rx2ajjmdVYE36L7pSPsU6ZoyPyoAgSmThPtPKn IYCt8kcXtfORPju7bU1ZI0dVFSgGp+fgK9YBo+IHTiX1aL5x3qEaV82VXya/Ghb1gGYsXq TBunXvU//VfzLrzvbY+7S8N89ln+sSOaLJ9nuHyCBCoxdWTzkzw8HvqeA0adcw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=sindominio.net header.s=mail header.b=DTK4UghM; dmarc=fail reason="SPF not aligned (relaxed)" header.from=sindominio.net (policy=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: 7.66 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=sindominio.net header.s=mail header.b=DTK4UghM; dmarc=fail reason="SPF not aligned (relaxed)" header.from=sindominio.net (policy=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: 700EA1080B X-Spam-Score: 7.66 X-Migadu-Scanner: scn1.migadu.com X-TUID: c7pPnlTGb1r6 On Sat Jul 16, 2022 at 3:23 PM CEST, Jon Hurst wrote: > 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)"))) Yay!! I've been hoping for this functionality, which also has been discussed over at IRC. Thanks, Jon! With my very basic elisp knowledge, I've tried to adapt this to the search (and unthreaded) views, with no luck. I have trouble understanding the face part. Since afaik in the search and unthreaded views there's no change in face for matching messages, I thought I could get away by removing that part. But this doesn't work: (defun inwit/notmuch-search-authors-or-to (format-string result) (let* ((headers (plist-get result :headers)) (to (plist-get headers :To)) (author (plist-get headers :From))) (format format-string (if (string-match "inwit" author) (concat "To: " (notmuch-tree-clean-address to)) author)))) (setq notmuch-search-result-format '(("date" . "%12s ") ("count" . "%-7s ") (inwit/notmuch-search-authors-or-to . "%-20s") ("subject" . "%s ") ("tags" . "(%s)"))) Any help would be greatly appreciated.