--- /dev/null
+Return-Path: <alpine.art.de@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 10164431FDB\r
+ for <notmuch@notmuchmail.org>; Sat, 11 Oct 2014 05:29:46 -0700 (PDT)\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 OhMNytjgbZbv for <notmuch@notmuchmail.org>;\r
+ Sat, 11 Oct 2014 05:29:38 -0700 (PDT)\r
+Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com\r
+ [209.85.217.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id BE808431FD0\r
+ for <notmuch@notmuchmail.org>; Sat, 11 Oct 2014 05:29:37 -0700 (PDT)\r
+Received: by mail-lb0-f173.google.com with SMTP id 10so4436558lbg.4\r
+ for <notmuch@notmuchmail.org>; Sat, 11 Oct 2014 05:29:36 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=date:message-id:from:to:cc:subject:in-reply-to:references\r
+ :mime-version:content-type:content-disposition\r
+ :content-transfer-encoding;\r
+ bh=vfFTDsXhrWPrj60iFLmwdfCKP/1/OzjlPSV/wRhwjjE=;\r
+ b=dVLCDrVtO/CKX2DPms+T7aa9cQsXMRuQxzqPDrgBDypzKmzx6AAYgOrrBmGv6JbfS/\r
+ 7YbRVRrSA7Ovb0a6INPmNoOGTofEfWIrBDJzdtxw4FknWvc1A23unCmquC2l5NMII1/g\r
+ HWQDxf8KEpKOwkGOZhIqfbtahGUax9hVMN9wWddvI9N34ggVjjHe+93JVs2DyDoF8nu9\r
+ WbrDwfAT3z1/aWwVjX+itamXxX96ZVR82MdwQqDlmOVadnxlpGp95Q8p5mKEe25RXOQF\r
+ YExOY3h/xDaohYU194Dt1e1WPJmTZeXs/zBLn4Gr6Fa7nOsZ3m5/5FH1tZOIW2KcY/HR\r
+ hK+w==\r
+X-Received: by 10.152.198.138 with SMTP id jc10mr11401929lac.59.1413030575113;\r
+ Sat, 11 Oct 2014 05:29:35 -0700 (PDT)\r
+Received: from localhost (p5B00F017.dip0.t-ipconnect.de. [91.0.240.23])\r
+ by mx.google.com with ESMTPSA id a9sm2657815laa.3.2014.10.11.05.29.33\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Sat, 11 Oct 2014 05:29:34 -0700 (PDT)\r
+Date: Sat, 11 Oct 2014 14:29:43 +0200\r
+Message-ID: <20141011142943.GD23373@TP_L520.localdomain>\r
+From: Franz Fellner <alpine.art.de@gmail.com>\r
+To: Ian Main <imain@stemwinder.org>\r
+Subject: Re: [PATCH] VIM: Add URI handling\r
+In-Reply-To: <543822f73d3fd_46ad163fe88cd@ovo.mains.priv.notmuch>\r
+References: <1412281423-22441-1-git-send-email-imain@stemwinder.org>\r
+ <20141010114457.GG28601@TP_L520.localdomain>\r
+ <543822f73d3fd_46ad163fe88cd@ovo.mains.priv.notmuch>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: 8bit\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: Sat, 11 Oct 2014 12:29:46 -0000\r
+\r
+Here is a working implementation.\r
+Please review carefully as I only can simulate ruby and vimscript\r
+knowledge from what I see in notmuch.vim sourcefile and quick\r
+googling.\r
+\r
+Regards\r
+Franz\r
+\r
+\r
+diff --git a/plugin/notmuch.vim b/plugin/notmuch.vim\r
+index 567f75c..ef9fefa 100644\r
+--- a/plugin/notmuch.vim\r
++++ b/plugin/notmuch.vim\r
+@@ -269,6 +269,14 @@ ruby << EOF\r
+ if uri.class == URI::MailTo\r
+ vim_puts("Composing new email to #{uri.to}.")\r
+ VIM::command("call s:compose('#{uri.to}')")\r
++ elsif uri.class == URI::MsgID\r
++ msg = $curbuf.message(uri.opaque)\r
++ if !msg\r
++ vim_puts("Message not found in NotMuch database: #{uri.to_s}")\r
++ else\r
++ vim_puts("Opening message #{msg.message_id} in thread #{msg.thread_id}.")\r
++ VIM::command("call s:show('thread:#{msg.thread_id}', '#{msg.message_id}')")\r
++ end\r
+ else\r
+ vim_puts("Opening #{uri.to_s}.")\r
+ cmd = VIM::evaluate('g:notmuch_open_uri')\r
+@@ -429,11 +437,12 @@ endfunction\r
+ \r
+ "" main\r
+ \r
+-function! s:show(thread_id)\r
++function! s:show(thread_id, msg_id)\r
+ call s:new_buffer('show')\r
+ setlocal modifiable\r
+ ruby << EOF\r
+ thread_id = VIM::evaluate('a:thread_id')\r
++ msg_id = VIM::evaluate('a:msg_id')\r
+ $cur_thread = thread_id\r
+ $messages.clear\r
+ $curbuf.render do |b|\r
+@@ -465,6 +474,9 @@ ruby << EOF\r
+ end\r
+ b << ""\r
+ nm_m.end = b.count\r
++ if msg_id and nm_m.message_id == msg_id\r
++ VIM::command("normal #{nm_m.start}zt")\r
++ end\r
+ end\r
+ b.delete(b.count)\r
+ end\r
+@@ -487,7 +499,7 @@ ruby << EOF\r
+ when 1; $cur_filter = nil\r
+ when 2; $cur_filter = $cur_search\r
+ end\r
+- VIM::command("call s:show('#{id}')")\r
++ VIM::command("call s:show('#{id}', '')")\r
+ EOF\r
+ endfunction\r
+ \r
+@@ -917,6 +929,10 @@ ruby << EOF\r
+ q\r
+ end\r
+ \r
++ def message(id)\r
++ @db.find_message(id)\r
++ end\r
++\r
+ def close\r
+ @queries.delete_if { |q| ! q.destroy! }\r
+ @db.close\r
+@@ -937,12 +953,20 @@ ruby << EOF\r
+ end\r
+ end\r
+ \r
++ module URI\r
++ class MsgID < Generic\r
++ end\r
++\r
++ @@schemes['ID'] = MsgID\r
++ end\r
++\r
+ class Message\r
+ attr_accessor :start, :body_start, :end\r
+- attr_reader :message_id, :filename, :mail\r
++ attr_reader :message_id, :thread_id, :filename, :mail\r
+ \r
+ def initialize(msg, mail)\r
+ @message_id = msg.message_id\r
++ @thread_id = msg.thread_id\r
+ @filename = msg.filename\r
+ @mail = mail\r
+ @start = 0\r
+\r
+On Fri, 10 Oct 2014 11:18:31 -0700, Ian Main <imain@stemwinder.org> wrote:\r
+> Franz Fellner wrote:\r
+> > Works nice. Tested with an https and a mailto URI.\r
+> > But it would be awesome if you could add message id handling, So one\r
+> > could easily navigate to linked messages. I only found emacs client\r
+> > implement this feature. What I read in the docs about ruby URI module\r
+> > it should be fairly easy to add a custom scheme for id.\r
+> \r
+> I'm afraid I'm not sure what you mean by message id handling? It's\r
+> probably something simple but .. :)\r
+> \r
+> Ian\r