From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 +DKSHwnT72JHDgAAbAwnHQ (envelope-from ) for ; Sun, 07 Aug 2022 16:58:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GHCAHwnT72IMegAA9RJhRA (envelope-from ) for ; Sun, 07 Aug 2022 16:58:17 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 EDAD962C0 for ; Sun, 7 Aug 2022 16:58:16 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 70E005F36B; Sun, 7 Aug 2022 14:58:13 +0000 (UTC) Received: from mail.kisara.moe (119.ip-51-38-65.eu [51.38.65.119]) by mail.notmuchmail.org (Postfix) with ESMTPS id 22C985E00F for ; Sun, 7 Aug 2022 14:58:11 +0000 (UTC) Received: from localhost.localdomain (unknown [141.98.252.161]) (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 mail.kisara.moe (Postfix) with ESMTPSA id 968C7A0B54; Sun, 7 Aug 2022 16:58:10 +0200 (CEST) From: Mohsin Kaleem To: David Bremner , notmuch@notmuchmail.org Subject: [PATCH 4/9] feat: Allow :exclude configuration in notmuch-hello Date: Sun, 7 Aug 2022 15:57:28 +0100 Message-Id: <20220807145733.129867-4-mohkale@kisara.moe> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220807145733.129867-1-mohkale@kisara.moe> References: <87v8re66mg.fsf@tethera.net> <20220807145733.129867-1-mohkale@kisara.moe> MIME-Version: 1.0 Message-ID-Hash: MOAE4PZ2PQBIKHT2LUPC6DFN766RBGUX X-Message-ID-Hash: MOAE4PZ2PQBIKHT2LUPC6DFN766RBGUX 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-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=1659884297; 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; bh=5JVTq+7S8udV13KOqOoFSKi0L2pPDTH2paoCy+cPTZc=; b=I8L36xjoIRUfU0WUgSRHcAUiSCvKOTPo66/yIpCiADCUxcMRAqJX1yWno4z5ZzS/TjlKyY Lk0HSmdgigjQJWf4qdV9zrK7DtWEIlW4Yk3syEnxZ3Vb1Xw9ZxI9Mer8moncvIFFh7kx9C THokCyOfEcKRxHd8aKmFl9V/0GVyE8OMEB8hh4j4cTjU+tcVx0YWTQjnFLe/ape5fwDnXI v66dV+upD9d1H1ZJXH+5bHDfiMJ4vq1YDqb5NnV1Pm7upwx/Msx8ezOIURmcXqZFZDxexL RRe1nd/yQSlwtw3ik/skzyyB/caHTsmbLWRZlxbYlWp11o3oaiyKkrDzkKZs2Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659884297; a=rsa-sha256; cv=none; b=oGR0GbCE96sGRP9FqfCxgJCE8KRTiTJP8/dvK5Ld2WhVuSuW+QmMnQY81UMMVoKzyWw1Ig AA3vhxFcWDlsiSlNQO4BpicosHAujJU3ZNLPdCy56w/PN/eW2pqbK0LCXdX8DNJOsCx2oq OZcWS9EMpXoNyPUPBABI6MSPdw4DV208R2GaO68csnWGIG4X6Xb1z8iF0D+3UoK1YuGG4v OrlxH2i3d/BlUuzKIovvlufJxjlXAvnlaLU5z4CU+MsvmTp8syBdz1XRyfE0bKvMndNXVk QrNBdUYPJm1DdkKvcGG2Ks6w9CiFlMYSiI2TQmOroCcpnTE5TZijtyZ8NgmAJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kisara.moe (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 3.84 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kisara.moe (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: EDAD962C0 X-Spam-Score: 3.84 X-Migadu-Scanner: scn1.migadu.com X-TUID: AjQbMK9OhMJ+ --- 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 4662e704..810f094e 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -143,6 +143,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 include mail with excluded tags in the + search. Possible values are `include', `exclude', + or nil. Nil means use the default value of + `notmuch-search-exclude'. :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 @@ -484,19 +488,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-exclude))) + (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 search-exclude))) + (t + (notmuch-search search-terms oldest-first exclude))))) (defun notmuch-saved-search-count (search) (car (notmuch--process-lines notmuch-command "count" search))) @@ -643,6 +647,10 @@ with `notmuch-hello-query-counts'." (newest-first nil) (oldest-first t) (otherwise notmuch-search-oldest-first))) + (exclude (cl-case (plist-get elem :excluded) + (exclude t) + (include nil) + (otherwise notmuch-search-exclude))) (search-type (plist-get elem :search-type)) (msg-count (plist-get elem :count))) (widget-insert (format "%8s " @@ -652,6 +660,7 @@ with `notmuch-hello-query-counts'." :notmuch-search-terms query :notmuch-search-oldest-first oldest-first :notmuch-search-type search-type + :notmuch-search-exclude exclude name) (setq column-indent (1+ (max 0 (- column-width (length name))))))) -- 2.37.1