[PATCH] emacs: filter tag completions by current query

classic Classic list List threaded Threaded
7 messages Options
William Casarin William Casarin
Reply | Threaded
Open this post in threaded view
|

[PATCH] emacs: filter tag completions by current query

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 <[hidden email]>
---
 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

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Edmondson David Edmondson
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] emacs: filter tag completions by current query

Looks good - a nice usability improvement.

On Monday, 2018-10-08 at 04:47:52 -07, William Casarin wrote:

> 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 <[hidden email]>
> ---
>  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
>
> _______________________________________________
> notmuch mailing list
> [hidden email]
> https://notmuchmail.org/mailman/listinfo/notmuch

dme.
--
Oh there ain't no way to say I love you more.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Jeff Templon Jeff Templon
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] emacs: filter tag completions by current query

hi guys,

a question from a newbie - where are all these things documented?  The
notmuch-emacs documentation that I could find was pretty basic IIRC.

Be glad to hear that I've been looking in the wrong places.

David Edmondson <[hidden email]> writes:

> Looks good - a nice usability improvement.

JT
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Edmondson David Edmondson
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] emacs: filter tag completions by current query

On Monday, 2018-10-08 at 14:46:25 +02, Jeff Templon wrote:

> hi guys,
>
> a question from a newbie - where are all these things documented?  The
> notmuch-emacs documentation that I could find was pretty basic IIRC.

Jeff, which things do you mean?

> Be glad to hear that I've been looking in the wrong places.
>
> David Edmondson <[hidden email]> writes:
>
>> Looks good - a nice usability improvement.
>
> JT

dme.
--
Please don't stand so close to me.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Jeff Templon Jeff Templon
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] emacs: filter tag completions by current query

Hi,

David Edmondson <[hidden email]> writes:

> On Monday, 2018-10-08 at 14:46:25 +02, Jeff Templon wrote:
>
>> hi guys,
>>
>> a question from a newbie - where are all these things documented?  The
>> notmuch-emacs documentation that I could find was pretty basic IIRC.
>
> Jeff, which things do you mean?

I see all sorts of things being discussed in these patches that look
useful, but they didn't seem to show up in the manual.  I'll try to
remember to jot it down next time, but there are a lot of things that
only seem to be mentioned if one does "C-h m" in the mode itself.

There is this "basic guide" (quotes from the doc itself):

https://notmuchmail.org/notmuch-emacs/

and this tips and tricks page

https://notmuchmail.org/emacstips/

I haven't found more documentation than this, except via Google and "C-h
m"

JT
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Edmondson David Edmondson
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] emacs: filter tag completions by current query

On Monday, 2018-10-08 at 15:14:50 +02, Jeff Templon wrote:

> Hi,
>
> David Edmondson <[hidden email]> writes:
>
>> On Monday, 2018-10-08 at 14:46:25 +02, Jeff Templon wrote:
>>
>>> hi guys,
>>>
>>> a question from a newbie - where are all these things documented?  The
>>> notmuch-emacs documentation that I could find was pretty basic IIRC.
>>
>> Jeff, which things do you mean?
>
> I see all sorts of things being discussed in these patches that look
> useful, but they didn't seem to show up in the manual.  I'll try to
> remember to jot it down next time, but there are a lot of things that
> only seem to be mentioned if one does "C-h m" in the mode itself.

We don't have a good manual, I agree.

Producing one is hard :-(

> There is this "basic guide" (quotes from the doc itself):
>
> https://notmuchmail.org/notmuch-emacs/
>
> and this tips and tricks page
>
> https://notmuchmail.org/emacstips/
>
> I haven't found more documentation than this, except via Google and "C-h
> m"


dme.
--
They like the smell of it in Hollywood.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] emacs: filter tag completions by current query

David Edmondson <[hidden email]> writes:

> On Monday, 2018-10-08 at 15:14:50 +02, Jeff Templon wrote:
>
>> Hi,
>>
>> David Edmondson <[hidden email]> writes:
>>
>>> On Monday, 2018-10-08 at 14:46:25 +02, Jeff Templon wrote:
>>>
>>>> hi guys,
>>>>
>>>> a question from a newbie - where are all these things documented?  The
>>>> notmuch-emacs documentation that I could find was pretty basic IIRC.
>>>
>>> Jeff, which things do you mean?
>>
>> I see all sorts of things being discussed in these patches that look
>> useful, but they didn't seem to show up in the manual.  I'll try to
>> remember to jot it down next time, but there are a lot of things that
>> only seem to be mentioned if one does "C-h m" in the mode itself.
>
> We don't have a good manual, I agree.
>
> Producing one is hard :-(
>

I posted a patch series some time ago [1] to bring docstrings into the
manual. It doesn't magically make it a good manual, but it makes it a
bit less discouraging to work on the manual, at least for me.

[1]: https://nmbug.notmuchmail.org/nmweb/show/20180614003245.25112-1-david%40tethera.net
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch