Re: [PATCH] emacs: support "notmuch new" as a notmuch-poll-script
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Mon, 12 Dec 2011 00:39:03 +0000 (04:39 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:45 +0000 (09:40 -0800)
d4/e3481ea97b1dbb2917d4c2ebfea71a252942c0 [new file with mode: 0644]

diff --git a/d4/e3481ea97b1dbb2917d4c2ebfea71a252942c0 b/d4/e3481ea97b1dbb2917d4c2ebfea71a252942c0
new file mode 100644 (file)
index 0000000..b862fab
--- /dev/null
@@ -0,0 +1,153 @@
+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 0A17A429E26\r
+       for <notmuch@notmuchmail.org>; Sun, 11 Dec 2011 16:39:44 -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 qoAnJB7eCJcG for <notmuch@notmuchmail.org>;\r
+       Sun, 11 Dec 2011 16:39: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 B3734429E25\r
+       for <notmuch@notmuchmail.org>; Sun, 11 Dec 2011 16:39:41 -0800 (PST)\r
+Received: by bkat8 with SMTP id t8so5175596bka.26\r
+       for <notmuch@notmuchmail.org>; Sun, 11 Dec 2011 16:39:38 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+       :message-id:mime-version:content-type:content-transfer-encoding;\r
+       bh=zepvW4d1l8N81LY4bcdCG8lOKGU+McwdxfoHvY8ObXw=;\r
+       b=nbRgtTc1Z9PK/W8Cz99gGreTQmHqikmWkuuvOQqiJ7L41ibiXHzyVzmGn2HQQDPQmN\r
+       s/1twNNvgGIdZNoMmbD5r3ZmF72Wp1gzAtiYFHHhYx1gVFDD9o9k86+YWGqC4cm1aJw3\r
+       Om+cxJfpwXOZx+yKifUhLUXywiro1kl7tnd0o=\r
+Received: by 10.205.122.70 with SMTP id gf6mr1912499bkc.48.1323650378737;\r
+       Sun, 11 Dec 2011 16:39:38 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id l5sm27581092bkv.9.2011.12.11.16.39.37\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sun, 11 Dec 2011 16:39:38 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: Austin Clements <amdragon@MIT.EDU>, Jani Nikula <jani@nikula.org>\r
+Subject: Re: [PATCH] emacs: support "notmuch new" as a notmuch-poll-script\r
+In-Reply-To: <20111212003103.GI2760@mit.edu>\r
+References: <1323640100-18326-1-git-send-email-jani@nikula.org>\r
+       <87wra26a5u.fsf@gmail.com> <20111211225822.GH2760@mit.edu>\r
+       <CAB+hUn-ADRtZRCq5Ad6H6R2L246EBR8hOSsk4B2yeRsH4kN16w@mail.gmail.com>\r
+       <20111212003103.GI2760@mit.edu>\r
+User-Agent: Notmuch/0.10.2+94~g948b41d (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Mon, 12 Dec 2011 04:39:03 +0400\r
+Message-ID: <87fwgqfwt4.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+Cc: notmuch@notmuchmail.org\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 00:39:44 -0000\r
+\r
+On Sun, 11 Dec 2011 19:31:03 -0500, Austin Clements <amdragon@MIT.EDU> wrot=\r
+e:\r
+> Quoth Jani Nikula on Dec 12 at  1:10 am:\r
+> >    On Dec 12, 2011 12:56 AM, "Austin Clements" <[1]amdragon@mit.edu> wr=\r
+ote:\r
+> >    >\r
+> >    > Quoth Dmitry Kurochkin on Dec 12 at =C2=A02:00 am:\r
+> >    > > Hi Jani.\r
+> >    > >\r
+> >    > > On Sun, 11 Dec 2011 23:48:20 +0200, Jani Nikula <[2]jani@nikula.=\r
+org>\r
+> >    wrote:\r
+> >    > > > Let notmuch-poll-script be a function as well as a string. Make\r
+> >    default\r
+> >    > > > value nil instead of an empty string, but allow "" for backwar=\r
+ds\r
+> >    > > > compatibility. Add a notmuch poll function to call "notmuch ne=\r
+w"\r
+> >    using the\r
+> >    > > > configured notmuch-command.\r
+> >    > > >\r
+> >    > > > This allows taking better advantage of the "notmuch new" hooks=\r
+ from\r
+> >    emacs\r
+> >    > > > without intermediate scripts.\r
+> >    > > >\r
+> >    > >\r
+> >    > > I was just thinking about working on this myself :)\r
+> >    > >\r
+> >    > > I think a better solution would be to allow running a command wi=\r
+th\r
+> >    > > arguments. =C2=A0Creating a elisp function just to run a command=\r
+ with some\r
+> >    > > parameters feels wrong. =C2=A0This way we would have to add anot=\r
+her\r
+> >    function\r
+> >    > > each time we want to add another argument.\r
+> >    >\r
+> >    > This seems a little awkward to me, too, though perhaps it's the be=\r
+st\r
+> >    > way. =C2=A0Other approaches to consider include accepting a list f=\r
+or\r
+> >    > notmuch-poll-script (e.g., ("notmuch" "new")) or leaving it as a\r
+> >    > string but treating it as a shell command so "notmuch new" would J=\r
+ust\r
+> >    > Work. =C2=A0Personally, I think the latter is the most intuitive, =\r
+but it\r
+> >    > would be worth looking at how other customizable external commands=\r
+ are\r
+> >    > done in Emacs.\r
+> >    >\r
+> >    > A function seems powerful, but also like overkill. =C2=A0Can you g=\r
+ive a use\r
+> >    > case for a function that wouldn't be more easily solved by one of =\r
+the\r
+> >    > above approaches?\r
+> >=20\r
+> >    The only reason I had for using a function was running notmuch using\r
+> >    notmuch-command. Any ideas how to do that with the Just Works approa=\r
+ch?\r
+>=20\r
+> Oh, I see.  I'd missed that.\r
+>=20\r
+> So here's another idea, prefaced with a rant.\r
+>=20\r
+> It's bothered me for a long time that notmuch-emacs didn't just know\r
+> by default how to check for new mail.  What MUA doesn't know how to\r
+> check for new mail?  Why does a new user of notmuch have to tell it\r
+> how to check for new mail?  Of course, this *had* to be configured\r
+> before because everyone had their own way of checking for new mail.\r
+> Hooks eliminate this unnecessary flexibility and make "notmuch new"\r
+> the one true way to check for new mail---as it ought to be---and in\r
+> turn make the notmuch-poll-script variable obsolete.\r
+>=20\r
+> So, what about changing the default "" setting of notmuch-poll-script\r
+> from meaning "do nothing and be useless" to meaning "run notmuch new\r
+> (using notmuch-command)"?  It will then automatically do the right\r
+> thing for new users, while still being backward-compatible and\r
+> allowing an escape hatch for bizarre situations.\r
+\r
+Fine with me.  AFAIK no one has asked for using custom functions for\r
+notmuch-poll-script, so adding a sane default may be the simplest and\r
+the best option.\r
+\r
+Regards,\r
+  Dmitry\r