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 878946DE01F8 for ; Mon, 8 Oct 2018 04:48:04 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.057 X-Spam-Level: X-Spam-Status: No, score=-0.057 tagged_above=-999 required=5 tests=[AWL=0.143, 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 jCM2Lttv-P9M for ; Mon, 8 Oct 2018 04:48:04 -0700 (PDT) Received: from jb55.com (jb55.com [45.79.91.128]) by arlo.cworth.org (Postfix) with ESMTPS id E33A46DE0122; Mon, 8 Oct 2018 04:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d= jb55.com; h=from:to:subject:date:message-id; s=default; bh=JPbvnvZ/5w2y/JeK39lS/rQ4a7YOdfGTEsavKAvyXtg=; b=GE3Mt0wsy+20mfzLB6ZUlzaPXf5sW/3W9GP2KzPUEfaJqeBPOlM2P19AaxQUD+Hv1qLB8A+zB54hahsqzGkuZPAEq98mVtVDOVWKinr5GjuN2kNuAC4/EOQdJ6N0gJ/c82FVI40EiJtCkJKtzXkBOP//Lvc5W1VmdUrlD9HClvcrU0FYZ2j//X1BO14UFJAEn3kF33iYkefdr7ZJiVFkY/Mbuufy3y5Rjza180HP8Fa454ZUanMufg6gzpHC08HBhXP/W7uS9iOcKJIYaNSvDR9/ca0QlX5yG0VChWmVfoywVf1T7Oa1Ch38nvo5v1w+vlw+uRg/wIvWYsDriXjtTg== Received: from jb55.com (S010660e327dca171.vc.shawcable.net [24.84.152.187]) by jb55.com (OpenSMTPD) with ESMTPSA id 2ba133b9 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Mon, 8 Oct 2018 11:48:02 +0000 (UTC) From: William Casarin To: notmuch@notmuchmail.org Subject: [PATCH] emacs: filter tag completions by current query Date: Mon, 8 Oct 2018 04:47:52 -0700 Message-Id: <20181008114752.14457-1-jb55@jb55.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Mon, 08 Oct 2018 11:48:04 -0000 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))) (notmuch-search (concat notmuch-search-query-string " and tag:" tag) notmuch-search-oldest-first)) ;;;###autoload -- 2.19.0