[PATCH 07/21] vim: add option to save the patches of a patch series
authorFelipe Contreras <felipe.contreras@gmail.com>
Sat, 2 Nov 2013 13:55:40 +0000 (07:55 +1800)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:53 +0000 (09:57 -0800)
6a/1d5750fbc1cfd45bddbc339a732f35d3b87306 [new file with mode: 0644]

diff --git a/6a/1d5750fbc1cfd45bddbc339a732f35d3b87306 b/6a/1d5750fbc1cfd45bddbc339a732f35d3b87306
new file mode 100644 (file)
index 0000000..661ec2e
--- /dev/null
@@ -0,0 +1,103 @@
+Return-Path: <felipe.contreras@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 C95A0429E28\r
+       for <notmuch@notmuchmail.org>; Sat,  2 Nov 2013 07:03:39 -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 qXcNUj56B3Hf for <notmuch@notmuchmail.org>;\r
+       Sat,  2 Nov 2013 07:03:34 -0700 (PDT)\r
+Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com\r
+       [209.85.214.182]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 36714429E3F\r
+       for <notmuch@notmuchmail.org>; Sat,  2 Nov 2013 07:02:55 -0700 (PDT)\r
+Received: by mail-ob0-f182.google.com with SMTP id wn1so5653579obc.13\r
+       for <notmuch@notmuchmail.org>; Sat, 02 Nov 2013 07:02:54 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+       bh=suHNzO5EdpohLmcbrZxQHqChN/dQf0pU2V/MdSnFO/g=;\r
+       b=ng6SFmvbtPsuPBH2Z0EZRP5Gwj1qLlbKFxUWxOHnaj826eUkCAlLJLq8zjUP36QnAd\r
+       JWIDLbFAhnYdB6QLSxd0WBz+OhSFjisKRvsGl/+Sd8fD0f4umvjRmel6ETbqM/X/eUSj\r
+       7bIyhe2/R/ibFH/C7bLpnDR/+raJG8/nNcDqeufe/CX0Ie/z2lDbyFKYpqkba/yFjCnp\r
+       /IzeyNNicfY9FVL3GZVyqyF+pAK9dcVoKABu+sA0Myw/IkQ4FqMhG9vkc38JxOLZ9sgP\r
+       F+0Fof/cKYBX+r4oisF6lQOeJCfd6sXw0vo8kzU/kBiuZK906TXHHmq0RK/PdfdDapN6\r
+       HIkw==\r
+X-Received: by 10.182.153.226 with SMTP id vj2mr6585652obb.26.1383400974759;\r
+       Sat, 02 Nov 2013 07:02:54 -0700 (PDT)\r
+Received: from localhost (187-162-140-241.static.axtel.net. [187.162.140.241])\r
+       by mx.google.com with ESMTPSA id j9sm5190122oef.8.2013.11.02.07.02.53\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Sat, 02 Nov 2013 07:02:54 -0700 (PDT)\r
+From: Felipe Contreras <felipe.contreras@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 07/21] vim: add option to save the patches of a patch series\r
+Date: Sat,  2 Nov 2013 07:55:40 -0600\r
+Message-Id: <1383400554-1832-8-git-send-email-felipe.contreras@gmail.com>\r
+X-Mailer: git-send-email 1.8.4.2+fc1\r
+In-Reply-To: <1383400554-1832-1-git-send-email-felipe.contreras@gmail.com>\r
+References: <1383400554-1832-1-git-send-email-felipe.contreras@gmail.com>\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, 02 Nov 2013 14:03:40 -0000\r
+\r
+Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
+---\r
+ vim/notmuch.vim | 15 +++++++++++++++\r
+ 1 file changed, 15 insertions(+)\r
+\r
+diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
+index a1c5e28..9cfa795 100644\r
+--- a/vim/notmuch.vim\r
++++ b/vim/notmuch.vim\r
+@@ -34,6 +34,7 @@ let g:notmuch_rb_show_maps = {\r
+       \ 'o':          'show_open_msg()',\r
+       \ 'e':          'show_extract_msg()',\r
+       \ 's':          'show_save_msg()',\r
++      \ 'p':          'show_save_patches()',\r
+       \ 'r':          'show_reply()',\r
+       \ '?':          'show_info()',\r
+       \ '<Tab>':      'show_next_msg()',\r
+@@ -181,6 +182,20 @@ ruby << EOF\r
+ EOF\r
+ endfunction\r
\r
++function! s:show_save_patches()\r
++ruby << EOF\r
++      q = $curbuf.query($cur_thread)\r
++      t = q.search_threads.first\r
++      n = 0\r
++      t.toplevel_messages.first.replies.each do |m|\r
++              next if not m['subject'] =~ /^\[PATCH.*\]/\r
++              file = "%04d.patch" % [n += 1]\r
++              system "notmuch show --format=mbox id:#{m.message_id} > #{file}"\r
++      end\r
++      vim_puts "Saved #{n} patches"\r
++EOF\r
++endfunction\r
++\r
+ function! s:show_tag(intags)\r
+       if empty(a:intags)\r
+               let tags = input('tags: ')\r
+-- \r
+1.8.4.2+fc1\r
+\r