Re: [PATCH v3] emacs: support "notmuch new" as a notmuch-poll-script
authorJani Nikula <jani@nikula.org>
Mon, 12 Dec 2011 21:13:11 +0000 (23:13 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:47 +0000 (09:40 -0800)
93/f6857b236451684c65a8a2892a88e5cbcb994e [new file with mode: 0644]

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