[PATCH] emacs: filter tag completions by current query
William Casarin
jb55 at jb55.com
Sat Nov 24 12:52:16 PST 2018
William Casarin <jb55 at jb55.com> 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 <jb55 at jb55.com>
> ---
> 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,
More information about the notmuch
mailing list