Open stsquad opened 3 years ago
Using the mu daemon would be much nicer rather than calling mu through shell. I've no real idea on how to do that though.
(Disclaimer: I'm the author of mu4e-maildirs-extension
)
I had to use shell commands when I wrote mu4e-maildirs-extension and it gave me lots of troubles. So I also agree with @stsquad that it is better to avoid it if possible.
AFAIK it is now possible to fetch unread/total counts via the daemon.
I think you need to pass the list of queries to mu4e~proc-ping
and after the pong is processed the results are stored in mu4e~server-props
variable (see also mu4e~main-bookmarks
function for an example).
Hope this helps, although I haven't followed the mu development so I may be wrong.
I've raised https://github.com/djcb/mu/issues/1845 to see what @djcb might have to say about it.
Thanks. Let's wait for an answer.
I'm finding a bunch of my queries are not updating because of escaping issues when calling (shell-command-to-string) with my default shell (fish). At a minimum it would probably make sense to factor out all the queries to a single common function where we can be sure of getting the escaping right. However going forward we should investigate if @djcb could consider an public API to make queries of the "mu" daemon which already has the database loaded in memory and could probably just count the number of hits for you and respond with that.