pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
697 stars 165 forks source link

Add a querylist buffer to display saved queries (aka saved search) #1011

Open lucc opened 7 years ago

lucc commented 7 years ago

Since recent versions notmuch offers the query:your_saved_query_name syntax (docs). We should have a buffer that works similar to the bufferlist and taglist buffers. It should list all defined queries from the notmuch database, on select the corresponding search query:foo should be executed to open the search buffer for that query.

TODO:

jmehne commented 6 years ago

This is something I'd love to use - are you still working on this? If not, I'd like to take a shot at it.

Even if the saved queries can't be retrieved with the python bindings (I guess that's still true - at least I didn't see anything regarding this topic in their NEWS file), they could just be read from the notmuch config file, no?

pazz commented 6 years ago

Quoting Julian Mehne (2017-12-06 22:58:17)

This is something I'd love to use - are you still working on this? If not, I'd like to take a shot at it.

Go for it :)

Even if the saved queries can't be retrieved with the python bindings (I guess that's still true - at least I didn't see anything regarding this topic in their NEWS file), they could just be read from the notmuch config file, no?

Yep

lucc commented 6 years ago

No it is not possible to read them from the config file. The<y are stored in the database. I started a upstream patch to add support for setting and getting these queries from the database. But at the moment this patch is stalled as I was not very motivated for a while. And as this PR is dependent on the upstream patch it is also stalled.

The upstream patch starts at id:7cb0da4d17891d1284b14dbdbe116c65dfaf0195.1496596853.git.l-m-h@web.de in the notmuch mailing list.

The main problem was the naming scheme (the code is finished and is simple). Maybe I can propose another version upstream.

jmehne commented 6 years ago

No it is not possible to read them from the config file.

Meh, you're right, I misread the man page ...

Hm, okay - I think I'll just go ahead and for a proof-of-concept I'll just read the queries from the command line for now. If you find the time it would of course be great if you can propose another version.

lucc commented 6 years ago

I posted an updated version of the patch upstream: https://notmuchmail.org/pipermail/notmuch/2017/025921.html

lucc commented 6 years ago

The upstream patch landed: https://notmuchmail.org/pipermail/notmuch/2017/026020.html

notmuch 0.25.3 was released recently so it should be in the .4 release or in 0.26 the latest.

pazz commented 6 years ago

Great! thanks for the heads up!

jmehne commented 6 years ago

I have a basic hack here that is more or less just a copy of the taglist buffer. It is obviously not meant to be merged, but before I polish that I'd like to know what you'd actually like to have?

For a basic implementation, I think it:

Questions:

Long-term, I was thinking about letting the user configure that buffer: like, add the ability to group specified saved queries with sections that can be collapsed/expanded in the user interface. For example, I could have a [work] and a [private] section.

varac commented 6 years ago

Hej, any progress on this ? I'd love to use this feature !

jmehne commented 6 years ago

Unfortunately, no further progress from my side and I don't have enough free time at the moment. So whoever wants to pick this up, go for it 👍