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 589E1429E26 for ; Mon, 12 Dec 2011 12:12:40 -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 eakC8iZ59Mw2 for ; Mon, 12 Dec 2011 12:12:39 -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 70E4D429E25 for ; Mon, 12 Dec 2011 12:12:39 -0800 (PST) Received: by bkat8 with SMTP id t8so6320477bka.26 for ; Mon, 12 Dec 2011 12:12:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=VqOycFaiHOgoQV2FinP6Eai5AlrIkpl+1aVuieoM894=; b=YRZWsztoA3zsH+JN9UKVaKZdinehVhqpDEuzk/yWasCrV4MeJGnchf8VLoxlX2fO8V TDOGpBpJ5Rc0csml7viwLADB0Ao3Noj+NwMNpI6NlfCa8JTLvw5i0f0VKYv/mrti9z/p IDI1PlDtzpSQHTLaXrtajMg7dH0MLb34phlE4= Received: by 10.204.156.208 with SMTP id y16mr10876939bkw.72.1323720757949; Mon, 12 Dec 2011 12:12:37 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id q16sm1646883bky.10.2011.12.12.12.12.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Dec 2011 12:12:36 -0800 (PST) From: Dmitry Kurochkin To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH v2] emacs: support "notmuch new" as a notmuch-poll-script In-Reply-To: <1323719848-27958-1-git-send-email-jani@nikula.org> References: <1323640100-18326-1-git-send-email-jani@nikula.org> <1323719848-27958-1-git-send-email-jani@nikula.org> User-Agent: Notmuch/0.10.2+94~g948b41d (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Tue, 13 Dec 2011 00:12:01 +0400 Message-ID: <87obvdblda.fsf@gmail.com> 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 20:12:40 -0000 Hi Jani. On Mon, 12 Dec 2011 21:57:28 +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 Looks good to me. Few comments regarding documentation below. > --- > 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 Please s/non empty/non-empty string/ to make it more clear. > +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 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." s/though/using/? Would be nice to mention that using hooks is the recommended way for this. > + :type '(choice (const :tag "Notmuch new" nil) Perhaps s/Notmuch/notmuch/ because we are talking about a command here? Regards, Dmitry > + (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