--- /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 9AB4F431FBF\r
+ for <notmuch@notmuchmail.org>; Fri, 10 Oct 2014 02:44:58 -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 7-SUdMkrZ39w for <notmuch@notmuchmail.org>;\r
+ Fri, 10 Oct 2014 02:44:51 -0700 (PDT)\r
+Received: from mail-la0-f44.google.com (mail-la0-f44.google.com\r
+ [209.85.215.44]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 1C72E431FBC\r
+ for <notmuch@notmuchmail.org>; Fri, 10 Oct 2014 02:44:50 -0700 (PDT)\r
+Received: by mail-la0-f44.google.com with SMTP id hs14so2835564lab.31\r
+ for <notmuch@notmuchmail.org>; Fri, 10 Oct 2014 02:44:49 -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:subject:in-reply-to:references:mime-version\r
+ :content-type:content-disposition:content-transfer-encoding;\r
+ bh=GDCdTPNQvzDxSo1TqZG1AmVGDq30JuUJ+4zfpXPSIn8=;\r
+ b=YeSO3XIlGc4UHcR0/iqu0rBC1KM1IzqNii3RnkNk8XSoSFhLxYVQm5HKdbqSMwi+dH\r
+ dQB3XJVSB0Ui/0ptnpnaAWnyKhNssK+6x1/hO0Yx02yEbtvw1p3IYezTdPB1wZpwxchr\r
+ fbYoKgVbOpHAg0BPiloTQsF299BwusXOKVHGfjUrLh5a6a77HDJG429bJN7Fek92GgFt\r
+ r65cI2Cs+YlH5UbtcvtUdQXpuYBfy/m4I3hVt/a95SCWGFmiNFxswQ/TCJnyCqrbJjfu\r
+ lH+CBRP9Q5yZPcMaqTgZ0ENi2tpRqODDMvoNcjZlq4SpSzac7ZIpXil/X3GyDwaqDbGq\r
+ OmEg==\r
+X-Received: by 10.112.201.72 with SMTP id jy8mr3420236lbc.78.1412934289222;\r
+ Fri, 10 Oct 2014 02:44:49 -0700 (PDT)\r
+Received: from localhost (p5B00C9E6.dip0.t-ipconnect.de. [91.0.201.230])\r
+ by mx.google.com with ESMTPSA id p5sm1684154lag.1.2014.10.10.02.44.47\r
+ for <notmuch@notmuchmail.org>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Fri, 10 Oct 2014 02:44:48 -0700 (PDT)\r
+Date: Fri, 10 Oct 2014 11:44:57 +0200\r
+Message-ID: <20141010114457.GG28601@TP_L520.localdomain>\r
+From: Franz Fellner <alpine.art.de@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] VIM: Add URI handling\r
+In-Reply-To: <1412281423-22441-1-git-send-email-imain@stemwinder.org>\r
+References: <1412281423-22441-1-git-send-email-imain@stemwinder.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: 8bit\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: Fri, 10 Oct 2014 09:44:58 -0000\r
+\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
+On Thu, 2 Oct 2014 13:23:43 -0700, Ian Main <imain@stemwinder.org> wrote:\r
+> This patch adds URI handling to the vim client. You can now press\r
+> 'u' by default and the client will parse the current line and find\r
+> any URIs available. If there are more than one it opens the one\r
+> under the cursor or else it opens the only one available. It also\r
+> supports mailto: URI's and will compose a new message when activated.\r
+> \r
+> By default xdg-open is used for everything but mailto: which generally\r
+> does the right thing afaict.\r
+> \r
+> Ian\r
+> ---\r
+> vim/notmuch.txt | 1 +\r
+> vim/notmuch.vim | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++-------\r
+> 2 files changed, 53 insertions(+), 7 deletions(-)\r
+> \r
+> diff --git a/vim/notmuch.txt b/vim/notmuch.txt\r
+> index 4374102..d336406 100644\r
+> --- a/vim/notmuch.txt\r
+> +++ b/vim/notmuch.txt\r
+> @@ -72,6 +72,7 @@ q Quit view\r
+> A Archive (-inbox -unread)\r
+> I Mark as read (-unread)\r
+> t Tag (prompted)\r
+> +u Open URI\r
+> s Search\r
+> p Save patches\r
+> r Reply\r
+> diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
+> index 331e930..de82bb9 100644\r
+> --- a/vim/notmuch.vim\r
+> +++ b/vim/notmuch.vim\r
+> @@ -12,7 +12,7 @@ let g:notmuch_folders_maps = {\r
+> \ '<Enter>': 'folders_show_search()',\r
+> \ 's': 'folders_search_prompt()',\r
+> \ '=': 'folders_refresh()',\r
+> - \ 'c': 'compose()',\r
+> + \ 'c': 'compose("")',\r
+> \ }\r
+> \r
+> let g:notmuch_search_maps = {\r
+> @@ -25,7 +25,7 @@ let g:notmuch_search_maps = {\r
+> \ 's': 'search_search_prompt()',\r
+> \ '=': 'search_refresh()',\r
+> \ '?': 'search_info()',\r
+> - \ 'c': 'compose()',\r
+> + \ 'c': 'compose("")',\r
+> \ }\r
+> \r
+> let g:notmuch_show_maps = {\r
+> @@ -37,10 +37,11 @@ let g:notmuch_show_maps = {\r
+> \ 'e': 'show_extract_msg()',\r
+> \ 's': 'show_save_msg()',\r
+> \ 'p': 'show_save_patches()',\r
+> + \ 'u': 'show_open_uri()',\r
+> \ 'r': 'show_reply()',\r
+> \ '?': 'show_info()',\r
+> \ '<Tab>': 'show_next_msg()',\r
+> - \ 'c': 'compose()',\r
+> + \ 'c': 'compose("")',\r
+> \ }\r
+> \r
+> let g:notmuch_compose_maps = {\r
+> @@ -59,6 +60,7 @@ let s:notmuch_datetime_format_default = '%d.%m.%y %H:%M:%S'\r
+> let s:notmuch_reader_default = 'mutt -f %s'\r
+> let s:notmuch_sendmail_default = 'sendmail'\r
+> let s:notmuch_folders_count_threads_default = 0\r
+> +let s:notmuch_open_uri_default = 'xdg-open'\r
+> \r
+> function! s:new_file_buffer(type, fname)\r
+> exec printf('edit %s', a:fname)\r
+> @@ -135,8 +137,8 @@ function! s:show_reply()\r
+> startinsert!\r
+> endfunction\r
+> \r
+> -function! s:compose()\r
+> - ruby open_compose\r
+> +function! s:compose(to_email)\r
+> + ruby open_compose(VIM::evaluate('a:to_email'))\r
+> let b:compose_done = 0\r
+> call s:set_map(g:notmuch_compose_maps)\r
+> autocmd BufDelete <buffer> call s:on_compose_delete()\r
+> @@ -159,6 +161,45 @@ ruby << EOF\r
+> EOF\r
+> endfunction\r
+> \r
+> +function! s:show_open_uri()\r
+> + let line = getline(".")\r
+> + let pos = getpos(".")\r
+> + let col = pos[2]\r
+> +ruby << EOF\r
+> + m = get_message\r
+> + line = VIM::evaluate('line')\r
+> + col = VIM::evaluate('col') - 1\r
+> + uris = URI.extract(line)\r
+> + wanted_uri = nil\r
+> + if uris.length == 1\r
+> + wanted_uri = uris[0]\r
+> + else\r
+> + uris.each do |uri|\r
+> + # Check to see the URI is at the present cursor location\r
+> + idx = line.index(uri)\r
+> + if col >= idx and col <= idx + uri.length\r
+> + wanted_uri = uri\r
+> + break\r
+> + end\r
+> + end\r
+> + end\r
+> +\r
+> + if wanted_uri\r
+> + uri = URI.parse(wanted_uri)\r
+> + if uri.class == URI::MailTo\r
+> + vim_puts("Composing new email to #{uri.to}.")\r
+> + VIM::command("call s:compose('#{uri.to}')")\r
+> + else\r
+> + vim_puts("Opening #{uri.to_s}.")\r
+> + cmd = VIM::evaluate('g:notmuch_open_uri')\r
+> + system(cmd, uri.to_s)\r
+> + end\r
+> + else\r
+> + vim_puts('URI not found.')\r
+> + end\r
+> +EOF\r
+> +endfunction\r
+> +\r
+> function! s:show_open_msg()\r
+> ruby << EOF\r
+> m = get_message\r
+> @@ -404,6 +445,10 @@ function! s:set_defaults()\r
+> endif\r
+> endif\r
+> \r
+> + if !exists('g:notmuch_open_uri')\r
+> + let g:notmuch_open_uri = s:notmuch_open_uri_default\r
+> + endif\r
+> +\r
+> if !exists('g:notmuch_reader')\r
+> if exists('g:notmuch_rb_reader')\r
+> let g:notmuch_reader = g:notmuch_rb_reader\r
+> @@ -611,11 +656,11 @@ ruby << EOF\r
+> open_compose_helper(lines, cur)\r
+> end\r
+> \r
+> - def open_compose()\r
+> + def open_compose(to_email)\r
+> lines = []\r
+> \r
+> lines << "From: #{$email}"\r
+> - lines << "To: "\r
+> + lines << "To: #{to_email}"\r
+> cur = lines.count\r
+> \r
+> lines << "Cc: "\r
+> -- \r
+> 1.9.3\r
+> \r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r