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 75B98429E25 for ; Sun, 11 Dec 2011 15:10:39 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[HTML_MESSAGE=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 3pJCIvN8Yz37 for ; Sun, 11 Dec 2011 15:10:38 -0800 (PST) Received: from mail-pw0-f53.google.com (mail-pw0-f53.google.com [209.85.160.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id A49B9431FB6 for ; Sun, 11 Dec 2011 15:10:38 -0800 (PST) Received: by pbds6 with SMTP id s6so567966pbd.26 for ; Sun, 11 Dec 2011 15:10:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.73.34 with SMTP id i2mr28500441pbv.43.1323645037831; Sun, 11 Dec 2011 15:10:37 -0800 (PST) Received: by 10.68.212.134 with HTTP; Sun, 11 Dec 2011 15:10:37 -0800 (PST) Received: by 10.68.212.134 with HTTP; Sun, 11 Dec 2011 15:10:37 -0800 (PST) In-Reply-To: <20111211225822.GH2760@mit.edu> References: <1323640100-18326-1-git-send-email-jani@nikula.org> <87wra26a5u.fsf@gmail.com> <20111211225822.GH2760@mit.edu> Date: Mon, 12 Dec 2011 01:10:37 +0200 Message-ID: Subject: Re: [PATCH] emacs: support "notmuch new" as a notmuch-poll-script From: Jani Nikula To: Austin Clements Content-Type: multipart/alternative; boundary=f46d0417071b49e4c804b3d920ce 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: Sun, 11 Dec 2011 23:10:39 -0000 --f46d0417071b49e4c804b3d920ce Content-Type: text/plain; charset=UTF-8 On Dec 12, 2011 12:56 AM, "Austin Clements" wrote: > > Quoth Dmitry Kurochkin on Dec 12 at 2:00 am: > > Hi Jani. > > > > On Sun, 11 Dec 2011 23:48:20 +0200, Jani Nikula 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 backwards > > > compatibility. Add a notmuch poll function to call "notmuch new" 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 with > > arguments. Creating a elisp function just to run a command with some > > parameters feels wrong. This way we would have to add another function > > each time we want to add another argument. > > This seems a little awkward to me, too, though perhaps it's the best > way. Other approaches to consider include accepting a list for > notmuch-poll-script (e.g., ("notmuch" "new")) or leaving it as a > string but treating it as a shell command so "notmuch new" would Just > Work. Personally, 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. Can you give a use > case for a function that wouldn't be more easily solved by one of the > above approaches? 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 approach? J. --f46d0417071b49e4c804b3d920ce Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Dec 12, 2011 12:56 AM, "Austin Clements" <amdragon@mit.edu> wrote:
>
> Quoth Dmitry Kurochkin on Dec 12 at =C2=A02:00 am:
> > Hi Jani.
> >
> > On Sun, 11 Dec 2011 23:48:20 +0200, Jani Nikula <jani@nikula.org> wrote:
> > > Let notmuch-poll-script be a function as well as a string. M= ake default
> > > value nil instead of an empty string, but allow ""= for backwards
> > > compatibility. Add a notmuch poll function to call "not= much new" 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 wit= h
> > arguments. =C2=A0Creating a elisp function just to run a command = with some
> > parameters feels wrong. =C2=A0This way we would have to add anoth= er 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 for > notmuch-poll-script (e.g., ("notmuch" "new")) or l= eaving it as a
> string but treating it as a shell command so "notmuch new" w= ould Just
> 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 give = a use
> case for a function that wouldn't be more easily solved by one of = the
> above approaches?

The only reason I had for using a function was running notmuch using not= much-command. Any ideas how to do that with the Just Works approach?

J.

--f46d0417071b49e4c804b3d920ce--