From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E50676DE01BB for ; Sat, 24 Nov 2018 12:52:18 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.303 X-Spam-Level: X-Spam-Status: No, score=-0.303 tagged_above=-999 required=5 tests=[AWL=-0.103, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YCh6jskuiwlE for ; Sat, 24 Nov 2018 12:52:17 -0800 (PST) Received: from jb55.com (jb55.com [45.79.91.128]) by arlo.cworth.org (Postfix) with ESMTPS id D225D6DE0134 for ; Sat, 24 Nov 2018 12:52:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d= jb55.com; h=from:to:subject:date:message-id; s=default; bh=8WUshZYXN8EsE4PdAe/w7rdhaNxPDxTchD76lL/EVb8=; b=J4b8kRbr2yxQWTj9oeXza84EymIvWQapowFvBIhpfumGnsqzyBcH0CE9fkk47qa6Jo8VNCnKM7w01SB/5bMTg8qTIJU6hXJngNuqz3fE0o9jkm+uWTDD7xjBHAOCAOVBuT/fUV8OXUTmEiKchQDlsc1CyKuPg5gMSjEaxrdDlRGzRYAecsrCyNCcJjAu8fiBnUxZxUBDWTqt9llvl2H765LGB8vnS3cpIzDfP9AWZGofajxTvTZt8ihlVpWGYXX7R8zrYiuzmE8PCuenqd/UuSm/lO4Cf0AQ34ZXLevzGZkfhOSqyTX0h5F+rXts7KenbYuCl/jpy9YqJkucMUk6aw== Received: from jb55.com (S010660e327dca171.vc.shawcable.net [24.84.152.187]) by jb55.com (OpenSMTPD) with ESMTPSA id c04bcf61 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO for ; Sat, 24 Nov 2018 20:52:16 +0000 (UTC) From: William Casarin To: notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: filter tag completions by current query In-Reply-To: <20181008114752.14457-1-jb55@jb55.com> References: <20181008114752.14457-1-jb55@jb55.com> Date: Sat, 24 Nov 2018 12:52:16 -0800 Message-ID: <878t1iyz9b.fsf@jb55.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 20:52:19 -0000 William Casarin writes: > When filtering by tags in notmuch-search-filter-by-tag, only return tags > related to the current query. > > Before, it was returning all tags. There's no reason to refine the > current query with tags that don't exist in the current result set. > > Signed-off-by: William Casarin > --- > emacs/notmuch.el | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > index 44402f8a..28c50425 100644 > --- a/emacs/notmuch.el > +++ b/emacs/notmuch.el > @@ -1076,7 +1076,7 @@ current search results AND the additional query string provided." > Runs a new search matching only messages that match both the > current search results AND that are tagged with the given tag." > (interactive > - (list (notmuch-select-tag-with-completion "Filter by tag: "))) > + (list (notmuch-select-tag-with-completion "Filter by tag: " notmuch-search-query-string))) For some more context here to move this patch along: notmuch-select-tag-with-completion only has one caller, this one. notmuch-select-tag-with-completion seems to expect this argument, for some reason it was never passed along. When it is not passed, it uses all tags ("*") for further refinement, which doesn't make sense in this context. Cheers,