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 0A17A429E26 for ; Sun, 11 Dec 2011 16:39:44 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 qoAnJB7eCJcG for ; Sun, 11 Dec 2011 16:39:42 -0800 (PST) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id B3734429E25 for ; Sun, 11 Dec 2011 16:39:41 -0800 (PST) Received: by bkat8 with SMTP id t8so5175596bka.26 for ; Sun, 11 Dec 2011 16:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; bh=zepvW4d1l8N81LY4bcdCG8lOKGU+McwdxfoHvY8ObXw=; b=nbRgtTc1Z9PK/W8Cz99gGreTQmHqikmWkuuvOQqiJ7L41ibiXHzyVzmGn2HQQDPQmN s/1twNNvgGIdZNoMmbD5r3ZmF72Wp1gzAtiYFHHhYx1gVFDD9o9k86+YWGqC4cm1aJw3 Om+cxJfpwXOZx+yKifUhLUXywiro1kl7tnd0o= Received: by 10.205.122.70 with SMTP id gf6mr1912499bkc.48.1323650378737; Sun, 11 Dec 2011 16:39:38 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id l5sm27581092bkv.9.2011.12.11.16.39.37 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 11 Dec 2011 16:39:38 -0800 (PST) From: Dmitry Kurochkin To: Austin Clements , Jani Nikula Subject: Re: [PATCH] emacs: support "notmuch new" as a notmuch-poll-script In-Reply-To: <20111212003103.GI2760@mit.edu> References: <1323640100-18326-1-git-send-email-jani@nikula.org> <87wra26a5u.fsf@gmail.com> <20111211225822.GH2760@mit.edu> <20111212003103.GI2760@mit.edu> User-Agent: Notmuch/0.10.2+94~g948b41d (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Mon, 12 Dec 2011 04:39:03 +0400 Message-ID: <87fwgqfwt4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: notmuch@notmuchmail.org 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: Mon, 12 Dec 2011 00:39:44 -0000 On Sun, 11 Dec 2011 19:31:03 -0500, Austin Clements wrot= e: > Quoth Jani Nikula on Dec 12 at 1:10 am: > > On Dec 12, 2011 12:56 AM, "Austin Clements" <[1]amdragon@mit.edu> wr= ote: > > > > > > Quoth Dmitry Kurochkin on Dec 12 at =C2=A02:00 am: > > > > Hi Jani. > > > > > > > > On Sun, 11 Dec 2011 23:48:20 +0200, Jani Nikula <[2]jani@nikula.= org> > > wrote: > > > > > Let notmuch-poll-script be a function as well as a string. Make > > default > > > > > value nil instead of an empty string, but allow "" for backwar= ds > > > > > compatibility. Add a notmuch poll function to call "notmuch ne= w" > > using the > > > > > configured notmuch-command. > > > > > > > > > > This allows taking better advantage of the "notmuch new" hooks= from > > emacs > > > > > without intermediate scripts. > > > > > > > > > > > > > I was just thinking about working on this myself :) > > > > > > > > I think a better solution would be to allow running a command wi= th > > > > arguments. =C2=A0Creating a elisp function just to run a command= with some > > > > parameters feels wrong. =C2=A0This way we would have to add anot= her > > function > > > > each time we want to add another argument. > > > > > > This seems a little awkward to me, too, though perhaps it's the be= st > > > way. =C2=A0Other approaches to consider include accepting a list f= or > > > notmuch-poll-script (e.g., ("notmuch" "new")) or leaving it as a > > > string but treating it as a shell command so "notmuch new" would J= ust > > > Work. =C2=A0Personally, I think the latter is the most intuitive, = but it > > > would be worth looking at how other customizable external commands= are > > > done in Emacs. > > > > > > A function seems powerful, but also like overkill. =C2=A0Can you g= ive a use > > > case for a function that wouldn't be more easily solved by one of = the > > > above approaches? > >=20 > > The only reason I had for using a function was running notmuch using > > notmuch-command. Any ideas how to do that with the Just Works approa= ch? >=20 > Oh, I see. I'd missed that. >=20 > So here's another idea, prefaced with a rant. >=20 > It's bothered me for a long time that notmuch-emacs didn't just know > by default how to check for new mail. What MUA doesn't know how to > check for new mail? Why does a new user of notmuch have to tell it > how to check for new mail? Of course, this *had* to be configured > before because everyone had their own way of checking for new mail. > Hooks eliminate this unnecessary flexibility and make "notmuch new" > the one true way to check for new mail---as it ought to be---and in > turn make the notmuch-poll-script variable obsolete. >=20 > So, what about changing the default "" setting of notmuch-poll-script > from meaning "do nothing and be useless" to meaning "run notmuch new > (using notmuch-command)"? It will then automatically do the right > thing for new users, while still being backward-compatible and > allowing an escape hatch for bizarre situations. Fine with me. AFAIK no one has asked for using custom functions for notmuch-poll-script, so adding a sane default may be the simplest and the best option. Regards, Dmitry