From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 8BJgH9v3O2T9IQAASxT56A (envelope-from ) for ; Sun, 16 Apr 2023 15:27:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id OB9cH9v3O2Q86gAA9RJhRA (envelope-from ) for ; Sun, 16 Apr 2023 15:27:55 +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 DABA0112F6 for ; Sun, 16 Apr 2023 15:27:54 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id EFC705E549; Sun, 16 Apr 2023 13:27:50 +0000 (UTC) X-Greylist: delayed 575 seconds by postgrey-1.36 at yantan; Sun, 16 Apr 2023 13:27:48 UTC Received: from mail.kisara.moe (119.ip-51-38-65.eu [51.38.65.119]) by mail.notmuchmail.org (Postfix) with ESMTPS id 0EC145DD5A for ; Sun, 16 Apr 2023 13:27:48 +0000 (UTC) Received: from localhost.localdomain (unknown [146.70.133.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id D5245A0FFD; Sun, 16 Apr 2023 15:18:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1681651100; bh=HP/XnKs79buewGywq7G+E04GBkepSbtRV3+QJihOkLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xgyQdqoz5AyUr4frgSvAgA2xAB7T6uJlD7Se99ozImp67wCp7bEpGS2rGt1YtSXZ9 8soLeKnRd9hY3gV54lGz93TNSVA/CzJio5b8ZYeJtX0ZFwnemVl+c+Sqm3vlaNNT+x ZESucZVjF3WdiodfJHVbLB8UyCV4NI5RQuB27o/5epJfGEfiUl/01JvaOJOWPU4pPO OckLW5P/vDXJMIV2gb8B5tEs49lBShJhyT80SsVMv3PZIo/3GncurX8KVdeoVPLER4 lMF4C1LPi36BVfbnTq/FmTvz818dihaY7st+w6X/SzBNPukvho3v9GNGKefYJyjWv6 vCA49rARoucPQ== From: mohkale@kisara.moe To: notmuch@notmuchmail.org, David Bremner Subject: [PATCH v2 2/3] emacs: Allow notmuch-saved-searches to hide excluded messages Date: Sun, 16 Apr 2023 14:18:10 +0100 Message-Id: <20230416131811.658253-3-mohkale@kisara.moe> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230416131811.658253-1-mohkale@kisara.moe> References: <87v8re66mg.fsf@tethera.net> <20230416131811.658253-1-mohkale@kisara.moe> MIME-Version: 1.0 Message-ID-Hash: ORO54LSZ2APOVCWOD74JQPOUJK6XV7D7 X-Message-ID-Hash: ORO54LSZ2APOVCWOD74JQPOUJK6XV7D7 X-MailFrom: mohkale@kisara.moe 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: Mohsin Kaleem 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-Country: DE X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681651675; a=rsa-sha256; cv=none; b=EZYlz2YZ65QGFmg2ehcmOAjCSdzUZN191gXF1MjTwId4KlZWSi5azVTGM9kAV7f0FCYcjC BQZzg7JBB4OaLjU7JRrEk0JkQEHS55mltm4L/S3T1a0hMU8VT8FOpOFbupttU4QYQ054OL ySR9EPxNygAscRA4cBMXlZDFggfa2V1Ga06roenmGJf+FmBk+TaPi38nEj+d7/mzDRdc61 ECTJ8lkFIyxz7WxutpMLx+c+Yo0CEuQeP3GTowmTTazBe/+kMxpcVkwq9yGQ6lNd/Z3kyu uMP6etUhXa5vhEsesT6oh4tK3uzbqLl//CTtVAkkk4Bf6NedJ/+Sm7w3aE4jDA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=kisara.moe header.s=default header.b=xgyQdqoz; 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; dmarc=fail reason="SPF not aligned (relaxed)" header.from=kisara.moe (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681651674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=3lhT2rqib9Diu6+wLoDK1X5NtHNFF0o9wa+q53WUZkA=; b=s3DFoXlVp/2h2+o9AYY50sIM5lHZOy8NYKuVBBcwUzN5mhUmpxuH4cWYWqpygOUfR2xnmm lZ06Hj6VKPFmRSPYomsavKs87nfp5jDJ57H4aCE0bx3mdfuj4Dru6t9nBZKF4N6Ce2Wk9+ uf3lzqHqZ8WG68faTTAVzk9P1G45gkaUfN4j836ANHvdl1dRHs2ujeFUNEe3qsheZtWney 1CSTrV85JbB+WB24DhTSiuumN3m7qU4cbSn4y+j5NaT4oBPujSEz7hQaTLSe+R7DFbL2dW 1jUwz5KMd4RH/HXN6h2nwk868UIq9BpUFe2+bgXfRxPsW6npzsSSPWiAEF2IAA== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -0.01 X-Spam-Score: -0.01 X-Migadu-Queue-Id: DABA0112F6 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=kisara.moe header.s=default header.b=xgyQdqoz; 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; dmarc=fail reason="SPF not aligned (relaxed)" header.from=kisara.moe (policy=none) X-TUID: BsP8pofumoFA From: Mohsin Kaleem --- emacs/notmuch-hello.el | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 6aef322a..6d4197dd 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -144,6 +144,10 @@ a plist. Supported properties are :sort-order Specify the sort order to be used for the search. Possible values are `oldest-first', `newest-first' or nil. Nil means use the default sort order. + :excluded Whether to show mail with excluded tags in the + search. Possible values are `hide', `show', + or nil. Nil means use the default value of + `notmuch-search-hide-excluded'. :search-type Specify whether to run the search in search-mode, tree mode or unthreaded mode. Set to `tree' to specify tree mode, 'unthreaded to specify @@ -485,19 +489,19 @@ diagonal." append (notmuch-hello-reflect-generate-row ncols nrows row list)))) (defun notmuch-hello-widget-search (widget &rest _ignore) - (cl-case (widget-get widget :notmuch-search-type) - (tree - (let ((n (notmuch-search-format-buffer-name (widget-value widget) "tree" t))) - (notmuch-tree (widget-get widget :notmuch-search-terms) - nil nil n nil nil nil - (widget-get widget :notmuch-search-oldest-first)))) - (unthreaded - (let ((n (notmuch-search-format-buffer-name (widget-value widget) - "unthreaded" t))) - (notmuch-unthreaded (widget-get widget :notmuch-search-terms) nil nil n))) - (t - (notmuch-search (widget-get widget :notmuch-search-terms) - (widget-get widget :notmuch-search-oldest-first))))) + (let ((search-terms (widget-get widget :notmuch-search-terms)) + (oldest-first (widget-get widget :notmuch-search-oldest-first)) + (exclude (widget-get widget :notmuch-search-hide-excluded))) + (cl-case (widget-get widget :notmuch-search-type) + (tree + (let ((n (notmuch-search-format-buffer-name (widget-value widget) "tree" t))) + (notmuch-tree search-terms nil nil n nil nil nil oldest-first exclude))) + (unthreaded + (let ((n (notmuch-search-format-buffer-name (widget-value widget) + "unthreaded" t))) + (notmuch-unthreaded search-terms nil nil n nil oldest-first exclude))) + (t + (notmuch-search search-terms oldest-first exclude))))) (defun notmuch-saved-search-count (search) (car (notmuch--process-lines notmuch-command "count" search))) @@ -644,6 +648,10 @@ with `notmuch-hello-query-counts'." (newest-first nil) (oldest-first t) (otherwise notmuch-search-oldest-first))) + (exclude (cl-case (plist-get elem :excluded) + (hide t) + (show nil) + (otherwise notmuch-search-hide-excluded))) (search-type (plist-get elem :search-type)) (msg-count (plist-get elem :count))) (widget-insert (format "%8s " @@ -653,6 +661,7 @@ with `notmuch-hello-query-counts'." :notmuch-search-terms query :notmuch-search-oldest-first oldest-first :notmuch-search-type search-type + :notmuch-search-hide-excluded exclude name) (setq column-indent (1+ (max 0 (- column-width (length name))))))) -- 2.40.0