Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 8A8E1431FD0 for ; Fri, 24 Jun 2011 11:29:29 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WO6bWpUe7HEF for ; Fri, 24 Jun 2011 11:29:28 -0700 (PDT) Received: from arlo.cworth.org (arlo.cworth.org [50.43.72.2]) by olra.theworths.org (Postfix) with ESMTP id 9547F431FB6 for ; Fri, 24 Jun 2011 11:29:28 -0700 (PDT) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 730D729A4FF; Fri, 24 Jun 2011 11:29:27 -0700 (PDT) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 633E0254157; Fri, 24 Jun 2011 11:29:27 -0700 (PDT) From: Carl Worth To: ccx@te2000.cz, notmuch@notmuchmail.org Subject: Re: Notmuch scripts In-Reply-To: <20110624112820.GA26201@dorje.inet.te2000> References: <20110624112820.GA26201@dorje.inet.te2000> User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) Date: Fri, 24 Jun 2011 11:29:21 -0700 Message-ID: <8762nvccce.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 18:29:29 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, 24 Jun 2011 13:28:21 +0200, ccx@te2000.cz wrote: > As some of you know I have written several scripts that aid using > notmuch, including an alternative to the notmuch-mutt perl script. Thanks for sharing these, Jan! > Since Carl Worth consented to include them into official distribution > I am now cleaning them up, writing docs and extending it so it covers > all features notmuch-mutt currently has. ... > Or you can browse the code at: > http://webprojekty.cz/ccx/loggerhead/zmuch/files It's been interesting for me to read through the README here. So much of the new functionality here consists of things I'd love to have implemented in the core command-line interface of notmuch, (I always have wanted it to be useful for direct command-line interaction by a human). Some of these features I think have even be implemented previously by Austin through his custom query parser. The features I see that I'd really like to see in the core notmuch command-line tool are: * Configurable "saved searches", (a syntax for expanding aliases for often-repeated search specifications). That's an idea we've had for a while. What's new with the zmuch implementation is the proposal of ":alias" for the syntax. I think I might like that quite a bit. It looks a bit easier to read (and type) than the previously-proposed "{alias}". * Delivery of search results to a maildir of symlinks The zmuch implementation has this functionality intertwined with something that also invokes mutt. Obviously, people using other MUAs might like to access this feature independently. I think I'd like to see this as: notmuch search --format=3Dmaildir:/path/to/directory * Operations on files matching search terms (move, remove, xargs) This isn't an operation I'd previously considered including in notmuch, but it does seem generally quite useful. Should we consider doing something like git does and allow something like "notmuch xargs" simply find and invoke a shell script named notmuch-xargs? Doing that could let us get a bunch of this functionality in place in the "core" sooner than if we waited for it to be re-implemented in C. Though if we did this, I think I'd be highly inclined to port the scripts from zsh to bash or even POSIX sh. How hard would that be? * Better date syntax for search specifications That's something that's obviously been missing from notmuch core from the beginning. And there have been several proposals with patches to do this in various ways. * Implicit concatenation of search terms with OR This seems like something easy to do with a command-line arguemnt. Perhaps "notmuch search --or ..." ? If we got all that into the core, then what would be left here would be: notmuch-mailvars.sh notmuch-mutt.sh These would provide integration of notmuch with mutt. notmuch-spam.sh notmuch-unspam.sh These would provide integration of notmuch with bsfilter, (and perhaps should be named to make that more clear---or generalized to justify the current name). notmuch-pager.sh I haven't looked at this to see what the colorization actually looks like, (I'm not always a huge fan of lots of color in my terminals). It seems that this would be more cleanly implemented as notmuch-colorize.sh or so and leave the pagination separate. If we had that, I'd feel really comfortable having each of those in contrib. I think contrib should be restricted to things which provide integration of notmuch with some external tool, (and should make that obvious by having a name like notmuch- or notmuch-.sh or whatever). All in all, there's definitely some very interesting functionality here, and I definitely appreciate you sharing it. Let's figure out the best way to get it all integrated into notmuch. Maybe in the meantime we throw everything into contrib even if some of it is seen as just proposals for better interfaces in the core tool? I don't know. > * Every application that does not act as a proxy should use > environment variable NOTMUCH to find the actual notmuch executable. >=20 > * Every application that acts as a proxy should ignore the NOTMUCH > variable That sounds reasonable enough to me. Perhaps these rules could go into a new contrib/README that would set out some guidelines for writing contrib tools, (such as notmuch- which I mentioned above). > Configuration and temporary files: > I like XDG specification. I'm missing some context to know what you're suggesting here. > I think it's bit unnecessary to have to have > config files that belong only to few scripts littered all around my > homedir. We should be able to put configuration for contrib tools into the main notmuch configuration file. If your tools don't want to read that file directly, they should be able to get by with the interfaces provided by "notmuch config set" and "notmuch config get". Obviously, each tool should create its own section in the configuration file. Is that an insane plan? > * Spam filter. Do you guys use any? What does it's interface look like? > I currently use bsfilter which I've found does it's job pretty > well. I've currently got amavis and spamassassin adding extra headers, (and below a certain threshold I've got maildrop delivering detected spam to a separate maildir). Currently, notmuch never sees the detected spam. Ever since we got folder: support I've been meaning to let notmuch see it so that I can use notmuch to dig into my spam when I suspect something got mis-detected. I don't currently have any system for getting user-provided feedback into my spam filtering. Do you get that with bsfilter? > * Colors. I use bright fg on dark bg, but I understand somebody won't > be happy with this choice. I'm pretty-much black-on-white only. I really want a similar experience with my computer that I get from books. (Though I'm still waiting for much better contrast from my computer displays=E2=80=94e-ink definitely hel= ps a lot for the very static use cases). > * New message processing. Currently I check for spam and I mute > selected threads. I can see this can be made quite configurable. > Maybe create procmail equivalent for notmuch? :-) I think lots of us have various hand-written scripts that call out to "notmuch tag" a bunch. It's definitely a common idiom to have "notmuch new" add a new tag, have the new-mail-processing script operate on tag:new, and then have that script remove tag:new from the things it processed. An alternative approach has been proposed to make "notmuch new" able to act on specified messages, (and accept an explicit list of tags to add). That would make it much easier to actually use existing tools like procmail directly with notmuch. Some people are currently using the notmuch-deliver.sh script in use cases like this. (And that script is another existing candidate for contrib.) =2DCarl =2D-=20 carl.d.worth@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk4E14EACgkQ6JDdNq8qSWhD7wCgg9onbYJXWTFyJp6DQr1Gdbvh pKIAoJDujLvSloL8CzRL7AXtxZVSc4XT =u3I8 -----END PGP SIGNATURE----- --=-=-=--