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 E7627429E26 for ; Mon, 12 Dec 2011 12:23:19 -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 iIzN9QfD-aXr for ; Mon, 12 Dec 2011 12:23:19 -0800 (PST) Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by olra.theworths.org (Postfix) with ESMTP id 3BABA429E25 for ; Mon, 12 Dec 2011 12:23:19 -0800 (PST) X-AuditID: 1209190d-b7f576d0000008c4-82-4ee662b6ea6f Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id 91.C2.02244.6B266EE4; Mon, 12 Dec 2011 15:23:18 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id pBCKNHHJ013006; Mon, 12 Dec 2011 15:23:18 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pBCKNFjg011240 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 12 Dec 2011 15:23:16 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1RaCQb-00062o-Ra; Mon, 12 Dec 2011 15:24:49 -0500 Date: Mon, 12 Dec 2011 15:24:49 -0500 From: Austin Clements To: Jani Nikula Subject: Re: [PATCH v2] emacs: support "notmuch new" as a notmuch-poll-script Message-ID: <20111212202449.GS2760@mit.edu> References: <1323640100-18326-1-git-send-email-jani@nikula.org> <1323719848-27958-1-git-send-email-jani@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1323719848-27958-1-git-send-email-jani@nikula.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkleLIzCtJLcpLzFFi42IRYrdT192W9MzPoHG2kkXTdGeL6zdnMjsw edy6/5rd49mqW8wBTFFcNimpOZllqUX6dglcGafPNTEXTJGpmHm6l7GB8YhYFyMHh4SAicS/ qUJdjJxAppjEhXvr2boYuTiEBPYxSjw+O48ZwtnAKHHo8BRmkCohgZNMEjOXm0EkljBKbOlr A0uwCKhK3J3wnAnEZhPQkNi2fzkjiC0ioCix+eR+MJtZQFri2+9msBphAV+JRw9ms4DYvALa EtO/fWCCWFAqsejmPGaIuKDEyZlPWCB6tSRu/HvJBHI1yJzl/zhAwpwCDhJLpq8BaxUVUJGY cnIb2wRGoVlIumch6Z6F0L2AkXkVo2xKbpVubmJmTnFqsm5xcmJeXmqRrpFebmaJXmpK6SZG UEhzSvLuYHx3UOkQowAHoxIPb6LvUz8h1sSy4srcQ4ySHExKorz3op75CfEl5adUZiQWZ8QX leakFh9ilOBgVhLhjXUDyvGmJFZWpRblw6SkOViUxHlrdj30ExJITyxJzU5NLUgtgsnKcHAo SfDWJgI1ChalpqdWpGXmlCCkmTg4QYbzAA23TgIZXlyQmFucmQ6RP8WoKCXOewqkWQAkkVGa B9cLSzmvGMWBXhHmLQep4gGmK7juV0CDmYAGx6U8ARlckoiQkmpgrPG90PLGnyHTuYXzBNvx fZGSgRYXrk5Ralmc3vDatDTTyY17U/ZJifomXbHOwj/Xjr3RKfc23FFpO8W5OPyo2amZS1xu 2m+P/1fjsFSyzTJ/zfM2qzs++wuWCrVbtKx9mbiiICpkQa7rN5fMz2H71i6anDr3/HOGs4pN 51Qcme37Kl1D955RYinOSDTUYi4qTgQAnxK1MxQDAAA= 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 20:23:20 -0000 Looks good to me. One documentation nitpick below. Quoth Jani Nikula on Dec 12 at 9:57 pm: > 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 > --- > emacs/notmuch.el | 34 ++++++++++++++++++++++++---------- > 1 files changed, 24 insertions(+), 10 deletions(-) > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > index 8936149..5a8ab9d 100644 > --- a/emacs/notmuch.el > +++ b/emacs/notmuch.el > @@ -965,28 +965,42 @@ 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 this variable is non empty, then it should name an external > +script to be run. If set to an empty string, no action is > +invoked. Finally, if set to nil (the default), \"notmuch new\" is > +run using the command specified by `notmuch-command'. The default should probably be given first. Also, "non empty" is a bit confusing, since nothing has been said about it being a string at that point. So, perhaps something like 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. > + > +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 same can be achieved through \"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."