Re: [PATCH v3] emacs: support "notmuch new" as a notmuch-poll-script
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Mon, 12 Dec 2011 20:53:05 +0000 (00:53 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:46 +0000 (09:40 -0800)
4e/42f0549653f06ccf24dc2b423adae3d0d44857 [new file with mode: 0644]

diff --git a/4e/42f0549653f06ccf24dc2b423adae3d0d44857 b/4e/42f0549653f06ccf24dc2b423adae3d0d44857
new file mode 100644 (file)
index 0000000..c3ac5a5
--- /dev/null
@@ -0,0 +1,151 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\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 68A93429E26\r
+       for <notmuch@notmuchmail.org>; Mon, 12 Dec 2011 12:53:43 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 V3ixSKzQo5jd for <notmuch@notmuchmail.org>;\r
+       Mon, 12 Dec 2011 12:53:42 -0800 (PST)\r
+Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 97FD4429E25\r
+       for <notmuch@notmuchmail.org>; Mon, 12 Dec 2011 12:53:42 -0800 (PST)\r
+Received: by bkat8 with SMTP id t8so6369247bka.26\r
+       for <notmuch@notmuchmail.org>; Mon, 12 Dec 2011 12:53:41 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+       :mime-version:content-type;\r
+       bh=C0O6HPrBYGZLSh2sAuafVYOk5IWko9eYNLzqjZcGDpo=;\r
+       b=RgKHxU4bUrhyimduKwxw9Pdfklg/j2hKxb65AYemnegCV3RDU0PqSyykXQxBrlCTbE\r
+       Hs4f0ChVssrDuD5/JBqT9tGb7vlMgVT6b3R48DMGyycRsDxWVBdyuIseu2kmiA9n5C6u\r
+       Mt7NY2tOkR0wMBtq3Gw4Dj+Ar2OSA7IEB0Qik=\r
+Received: by 10.204.128.197 with SMTP id l5mr11420001bks.58.1323723221183;\r
+       Mon, 12 Dec 2011 12:53:41 -0800 (PST)\r
+Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id\r
+       fg16sm35036990bkb.16.2011.12.12.12.53.39\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 12 Dec 2011 12:53:40 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v3] emacs: support "notmuch new" as a notmuch-poll-script\r
+In-Reply-To: <1323723004-32605-1-git-send-email-jani@nikula.org>\r
+References: <1323640100-18326-1-git-send-email-jani@nikula.org>\r
+       <1323723004-32605-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.10.2+94~g948b41d (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Tue, 13 Dec 2011 00:53:05 +0400\r
+Message-ID: <87liqhbjgu.fsf@gmail.com>\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 20:53:43 -0000\r
+\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
+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