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 900A3429E26 for ; Mon, 12 Dec 2011 13:13:18 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 O+y21-efFEsP for ; Mon, 12 Dec 2011 13:13:17 -0800 (PST) Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 9EA08429E25 for ; Mon, 12 Dec 2011 13:13:17 -0800 (PST) Received: by eaan11 with SMTP id n11so1388396eaa.26 for ; Mon, 12 Dec 2011 13:13:16 -0800 (PST) Received: by 10.14.8.16 with SMTP id 16mr3100961eeq.246.1323724396206; Mon, 12 Dec 2011 13:13:16 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. [80.220.92.23]) by mx.google.com with ESMTPS id a60sm79973450eeb.4.2011.12.12.13.13.13 (version=SSLv3 cipher=OTHER); Mon, 12 Dec 2011 13:13:15 -0800 (PST) From: Jani Nikula To: Dmitry Kurochkin , notmuch@notmuchmail.org Subject: Re: [PATCH v3] emacs: support "notmuch new" as a notmuch-poll-script In-Reply-To: <87liqhbjgu.fsf@gmail.com> References: <1323640100-18326-1-git-send-email-jani@nikula.org> <1323723004-32605-1-git-send-email-jani@nikula.org> <87liqhbjgu.fsf@gmail.com> User-Agent: Notmuch/0.10.2+104~gbfbf8b6 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) Date: Mon, 12 Dec 2011 23:13:11 +0200 Message-ID: <87r509wl20.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 21:13:18 -0000 On Tue, 13 Dec 2011 00:53:05 +0400, Dmitry Kurochkin wrote: > On Mon, 12 Dec 2011 22:50:04 +0200, Jani Nikula wrote: > > Support nil value for notmuch-poll-script to run "notmuch new" instead of > > an external script, and make this the new default. "notmuch new" is run > > using the configured notmuch-command. > > > > This allows taking better advantage of the "notmuch new" hooks from emacs > > without intermediate scripts. > > > > Signed-off-by: Jani Nikula > > > > --- > > > > v3: only documentation changes suggested by Austin and Dmitry. > > --- > > emacs/notmuch.el | 35 +++++++++++++++++++++++++---------- > > 1 files changed, 25 insertions(+), 10 deletions(-) > > > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > > index 8936149..675a110 100644 > > --- a/emacs/notmuch.el > > +++ b/emacs/notmuch.el > > @@ -965,28 +965,43 @@ same relative position within the new buffer." > > (notmuch-search query oldest-first target-thread target-line continuation) > > (goto-char (point-min)))) > > > > -(defcustom notmuch-poll-script "" > > +(defcustom notmuch-poll-script nil > > "An external script to incorporate new mail into the notmuch database. > > > > -If this variable is non empty, then it should name a script to be > > -invoked by `notmuch-search-poll-and-refresh-view' and > > +This variable controls the action invoked by > > +`notmuch-search-poll-and-refresh-view' and > > `notmuch-hello-poll-and-update' (each have a default keybinding > > -of 'G'). The script could do any of the following depending on > > +of 'G') to incorporate new mail into the notmuch database. > > + > > +If set to nil (the default), new mail is processed by invoking > > +\"notmuch new\". Otherwise, this should be set to a string that > > +gives the name of an external script that processes new mail. If > > +set to the empty string, no command will be run. > > I think this should be "an empty string". But I may be mistaking. Shameless copy paste from a native speaker, who am I to argue? :) Austin? Jani. > > Regards, > Dmitry > > > + > > +The external script could do any of the following depending on > > the user's needs: > > > > 1. Invoke a program to transfer mail to the local mail store > > 2. Invoke \"notmuch new\" to incorporate the new mail > > -3. Invoke one or more \"notmuch tag\" commands to classify the mail" > > - :type 'string > > +3. Invoke one or more \"notmuch tag\" commands to classify the mail > > + > > +Note that the recommended way of achieving the same is using > > +\"notmuch new\" hooks." > > + :type '(choice (const :tag "notmuch new" nil) > > + (const :tag "Disabled" "") > > + (string :tag "Custom script")) > > :group 'notmuch) > > > > (defun notmuch-poll () > > - "Run external script to import mail. > > + "Run \"notmuch new\" or an external script to import mail. > > > > -Invokes `notmuch-poll-script' if it is not set to an empty string." > > +Invokes `notmuch-poll-script', \"notmuch new\", or does nothing > > +depending on the value of `notmuch-poll-script'." > > (interactive) > > - (if (not (string= notmuch-poll-script "")) > > - (call-process notmuch-poll-script nil nil))) > > + (if (stringp notmuch-poll-script) > > + (if (not (string= notmuch-poll-script "")) > > + (call-process notmuch-poll-script nil nil)) > > + (call-process notmuch-command nil nil nil "new"))) > > > > (defun notmuch-search-poll-and-refresh-view () > > "Invoke `notmuch-poll' to import mail, then refresh the current view." > > -- > > 1.7.5.4 > > > > _______________________________________________ > > notmuch mailing list > > notmuch@notmuchmail.org > > http://notmuchmail.org/mailman/listinfo/notmuch