Hi Karel,
On Tue, May 14, 2013 at 11:30:41AM +0200, Karel Zak wrote:
On Mon, May 13, 2013 at 08:46:11PM +0200, Suvayu Ali wrote:
> I thought one possible solution might be introducing a hook to what ever
> function that does the file renaming when maildir flags are updated.
> I'm not sure how one can introduce a hook though. Another option would
> be to add a inotify watch on the maildir currently mutt is viewing. And
> follow-up on any inotify events.
Well, with virtual folders you don't have one maildir, there is
nothing like "the maildir currently mutt is viewing" ;-)
In the function nm_check_database() we check for notmuch DB mtime
changes, so we're able to detect changes. The question is if this
function works always correctly together with nm_sync() where we
write our (in-mutt) changes back to maildirs.
I have noticed the problem (inconsistent database) when trying to read
messages from regular maildirs too. So maybe your hunch about nm_sync()
and nm_check_database() not working well together is correct. Here is
one recipe to reproduce the problem:
Assumptions: `notmuch new' is run every 5 minutes.
Now if I read an email and write the changes to disk from mutt, calling
the notmuch cli fails in the 5 minute window until the next invocation
of `notmuch new'.
$ notmuch show id:878v3s829x@ch.ristopher.com
Error opening
<maildir>/cur/1367868776_0.31600.kuru.dyndns-at-home.com,U=45683,FMD5=3ba688d3536fd0a0303502d046ba5419:2,:
No such file or directory
5 minutes later:
$ notmuch show id:878v3s829x@ch.ristopher.com > /dev/null && echo pass
pass
Hopefully I explained the situation adequately.
I just read your other message. I had noticed your use of notmuch
deliver on one of the examples before, I'll look into it.
Cheers,
PS: I love this fork, and use it full time :).
--
Suvayu
Open source is the future. It sets us free.