--- /dev/null
+Return-Path: <wking@tremily.us>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 360ED6DE1A2F\r
+ for <notmuch@notmuchmail.org>; Fri, 1 Jan 2016 22:10:04 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.04\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.04 tagged_above=-999 required=5 tests=[AWL=0.041,\r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001,\r
+ SPF_PASS=-0.001] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 2oM1C5ZRy7NK for <notmuch@notmuchmail.org>;\r
+ Fri, 1 Jan 2016 22:10:02 -0800 (PST)\r
+Received: from resqmta-po-03v.sys.comcast.net (resqmta-po-03v.sys.comcast.net\r
+ [96.114.154.162])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id D412D6DE1A32\r
+ for <notmuch@notmuchmail.org>; Fri, 1 Jan 2016 22:09:52 -0800 (PST)\r
+Received: from resomta-po-18v.sys.comcast.net ([96.114.154.242])\r
+ by resqmta-po-03v.sys.comcast.net with comcast\r
+ id 0u9m1s0025E3ZMc01u9m5T; Sat, 02 Jan 2016 06:09:46 +0000\r
+Received: from mail.tremily.us ([73.221.72.168])\r
+ by resomta-po-18v.sys.comcast.net with comcast\r
+ id 0u7j1s00G3dr3C901u7k59; Sat, 02 Jan 2016 06:07:46 +0000\r
+Received: from ullr.tremily.us (unknown [192.168.10.7])\r
+ by mail.tremily.us (Postfix) with ESMTPS id B77FF1B2F575;\r
+ Fri, 1 Jan 2016 22:07:43 -0800 (PST)\r
+Received: (nullmailer pid 15113 invoked by uid 1000);\r
+ Sat, 02 Jan 2016 06:07:51 -0000\r
+From: "W. Trevor King" <wking@tremily.us>\r
+To: notmuch@notmuchmail.org\r
+Cc: David Bremner <david@tethera.net>,\r
+ Tomi Ollila <tomi.ollila@iki.fi>, Jani Nikula <jani@nikula.org>,\r
+ Carl Worth <cworth@cworth.org>, "W. Trevor King" <wking@tremily.us>\r
+Subject: [PATCH v2 2/4] nmbug-status: Add meta.message-url config setting\r
+Date: Fri, 1 Jan 2016 22:07:41 -0800\r
+Message-Id:\r
+ <9377a4c1265b13f9588d21ec0ea591ea9f61a05f.1451683912.git.wking@tremily.us>\r
+X-Mailer: git-send-email 2.1.0.60.g85f0837\r
+In-Reply-To: <cover.1451683912.git.wking@tremily.us>\r
+References: <cover.1451683912.git.wking@tremily.us>\r
+In-Reply-To: <cover.1451683912.git.wking@tremily.us>\r
+References: <cover.1451683912.git.wking@tremily.us>\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
+ s=q20140121; t=1451714986;\r
+ bh=Nnq9N1s17J4Xjz52SmfpWDWNd2bbsmDF/Pmv79592wg=;\r
+ h=Received:Received:Received:Received:From:To:Subject:Date:\r
+ Message-Id;\r
+ b=UzYBVpXGDwsggIk1yrXgzkqaEM0NC5VlATayi/nHxM1ZckSTgaO6vXurtLrSz84FX\r
+ 826+/+kaAED7dlBn5asowwmTqqf/gIsLO2QLjTKBowV6SLk5oIp/W5zam+lDJ/KaP0\r
+ jh2gaZ0G0Lc4EhcjmLX2MrS8HH5TwCXu6E+xziHczL+mkgFP3i4EuOfbCmXtgVYy5u\r
+ nlFLikhd93unaqqh/GxM1raD37upbUxCWAtJmAzq1et58UW9/kEiohfTVb4QI0635p\r
+ Xyl/gKo9E3FijMaMpGwT779tlWoQnEai9CuzgxET7iNv+zbZFsg+KIAV9ECOaZVDdx\r
+ FxurScC1b0c3Q==\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 02 Jan 2016 06:10:04 -0000\r
+\r
+So you can link to archives other than Gmane. For example, I'm doing\r
+this in [1].\r
+\r
+[1]: https://github.com/wking/nmbug-oci\r
+---\r
+ NEWS | 20 ++++++++++++++++++++\r
+ devel/nmbug/nmbug-status | 13 ++++++++++---\r
+ 2 files changed, 30 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/NEWS b/NEWS\r
+index 0a7a0e0..9f2e860 100644\r
+--- a/NEWS\r
++++ b/NEWS\r
+@@ -1,3 +1,23 @@\r
++Notmuch 0.22 (UNRELEASED)\r
++=========================\r
++\r
++nmbug-status\r
++------------\r
++\r
++`nmbug-status` now supports `meta.message-url` to override the Gmane\r
++template. For example, you can use:\r
++\r
++ {\r
++ "meta": {\r
++ "message-url": "https://groups.google.com/a/opencontainers.org/forum/#!search/messageid$3A%22{message-id}%22"\r
++ ...\r
++ },\r
++ ...\r
++ }\r
++\r
++To link to messages in the [opencontainers.org Google\r
++Groups](https://groups.google.com/a/opencontainers.org/forum/#!overview).\r
++\r
+ Notmuch 0.21 (2015-10-29)\r
+ =========================\r
+ \r
+diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status\r
+index b36b6ad..d72f1db 100755\r
+--- a/devel/nmbug/nmbug-status\r
++++ b/devel/nmbug/nmbug-status\r
+@@ -19,11 +19,11 @@\r
+ # You should have received a copy of the GNU General Public License\r
+ # along with this program. If not, see http://www.gnu.org/licenses/ .\r
+ \r
+-"""Generate HTML for one or more notmuch searches.\r
++"""Generate text and/or HTML for one or more notmuch searches.\r
+ \r
+ Messages matching each search are grouped by thread. Each message\r
+ that contains both a subject and message-id will have the displayed\r
+-subject link to the Gmane view of the message.\r
++subject link to an archive view of the message (defaulting to Gmane).\r
+ """\r
+ \r
+ from __future__ import print_function\r
+@@ -232,6 +232,10 @@ class Page (object):\r
+ class HtmlPage (Page):\r
+ _slug_regexp = re.compile('\W+')\r
+ \r
++ def __init__(self, message_url_template, **kwargs):\r
++ self.message_url_template = message_url_template\r
++ super(HtmlPage, self).__init__(**kwargs)\r
++\r
+ def _write_header(self, views, stream):\r
+ super(HtmlPage, self)._write_header(views=views, stream=stream)\r
+ stream.write('<ul>\n')\r
+@@ -292,8 +296,9 @@ class HtmlPage (Page):\r
+ 'message-id': quote(display_data['message-id']),\r
+ 'subject': xml.sax.saxutils.escape(display_data['subject']),\r
+ }\r
++ d['url'] = self.message_url_template.format(**d)\r
+ display_data['subject'] = (\r
+- '<a href="http://mid.gmane.org/{message-id}">{subject}</a>'\r
++ '<a href="{url}">{subject}</a>'\r
+ ).format(**d)\r
+ for key in ['message-id', 'from']:\r
+ if key in display_data:\r
+@@ -395,6 +400,8 @@ _PAGES['text'] = Page()\r
+ _PAGES['html'] = HtmlPage(\r
+ header=header_template.format(**context),\r
+ footer=footer_template.format(**context),\r
++ message_url_template=config['meta'].get(\r
++ 'message-url', 'http://mid.gmane.org/{message-id}'),\r
+ )\r
+ \r
+ if args.list_views:\r
+-- \r
+2.1.0.60.g85f0837\r
+\r