On Wed, May 24, 2017 at 09:34:12AM -0700, Kevin J. McCarthy wrote: > On Wed, May 24, 2017 at 05:19:01PM +0300, Lauri Tirkkonen wrote: > > I noticed that while mutt does support eg. IDLE for IMAP, it's not quite > > as useful as it could be because recv() is not actually called on the > > socket until timeout happens or terminal input is received. I made this > > horribly ugly patch that uses select(2) instead of waiting on just stdin > > -- it makes new mail/flag changes appear pretty much instantly if IDLE > > is used. It's mostly just a proof of concept: a clean implementation > > would require some more work around how input is handled. > > Thank you for the patch. I _will_ take a look at this, but I have a few > things on my todo list I need to work my way through first.
I've finally had a chance to take a closer look. I understand this is just a concept patch, but I'm not really keen on the idea. It's needing to peek into the input buffers (and should really be checking MacroBufferCount too). It's poorly/partially duplicating code in imap_keepalive() and imap_check_mailbox(). It makes km_dokey() even messier, and since that is used in many other places than the index, causes spin loops in places that don't care about the updates. And all this, just to get updates slightly faster, which could also be accomplished by setting $timeout to a smaller value. As always, I invite the other devs to take a look (especially Brendan, if you have a moment). But for now, I don't think I'm interested in this proposal. -- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
Description: PGP signature