--- /dev/null
+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 27EB3429E3A\r
+ for <notmuch@notmuchmail.org>; Sat, 2 Nov 2013 07:03:41 -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 9AYNo2pR5rd7 for <notmuch@notmuchmail.org>;\r
+ Sat, 2 Nov 2013 07:03:36 -0700 (PDT)\r
+Received: from mail-oa0-f53.google.com (mail-oa0-f53.google.com\r
+ [209.85.219.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id ABC7A429E42\r
+ for <notmuch@notmuchmail.org>; Sat, 2 Nov 2013 07:02:57 -0700 (PDT)\r
+Received: by mail-oa0-f53.google.com with SMTP id n12so5608288oag.40\r
+ for <notmuch@notmuchmail.org>; Sat, 02 Nov 2013 07:02:57 -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=QYBn6TMY4w2fUbM01XcsddSs2LoB2WyWQUp98+z3tG8=;\r
+ b=gSrDlLwpEIQ5I4zALwdX1nlhaAlmEIUN418Rip55Wvgp/XRTR/cdk4hlmtgdondDGK\r
+ ipBOapD4Md7HsdWrCrLNx8xFIzfpbIOAQYzTsrjS8bimR0iCo8tJ8Pnyun70Dfh8BBcE\r
+ EnmLiwOtoZ3cgsGYMDj1RqY95cEJ9eOuOHRsSShOaz/crPG2JY71Yzmv8eF+HAjz0YYd\r
+ Eb1DDWfoX65JP59AEBkVrTfjGHED5JK18IyZ1gflbYhAnOi8bjUsGKSPw12UGGP2DTlR\r
+ FLyBzk4RJc7JhhkvwdactdIWSR+toX9zrmZ72qCPTy59KNjTWWmACu+/UPqHVeQp1X12\r
+ 6uPA==\r
+X-Received: by 10.60.133.233 with SMTP id pf9mr1410442oeb.46.1383400977183;\r
+ Sat, 02 Nov 2013 07:02:57 -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\r
+ ee7sm24743429oeb.5.2013.11.02.07.02.55 for <multiple recipients>\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sat, 02 Nov 2013 07:02:56 -0700 (PDT)\r
+From: Felipe Contreras <felipe.contreras@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 08/21] vim: allow calling with arguments\r
+Date: Sat, 2 Nov 2013 07:55:41 -0600\r
+Message-Id: <1383400554-1832-9-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:41 -0000\r
+\r
+For example:\r
+\r
+ :NotMuch date:today\r
+\r
+Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
+---\r
+ vim/notmuch.vim | 22 ++++++++++++++--------\r
+ 1 file changed, 14 insertions(+), 8 deletions(-)\r
+\r
+diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
+index 9cfa795..aa1b7ef 100644\r
+--- a/vim/notmuch.vim\r
++++ b/vim/notmuch.vim\r
+@@ -273,12 +273,14 @@ function! s:show_next_thread()\r
+ endfunction\r
+ \r
+ function! s:kill_this_buffer()\r
+- ruby $curbuf.close\r
+- bdelete!\r
+ ruby << EOF\r
+- $buf_queue.pop\r
+- b = $buf_queue.last\r
+- VIM::command("buffer #{b}") if b\r
++ if $buf_queue.size > 1\r
++ $curbuf.close\r
++ VIM::command("bdelete!")\r
++ $buf_queue.pop\r
++ b = $buf_queue.last\r
++ VIM::command("buffer #{b}") if b\r
++ end\r
+ EOF\r
+ endfunction\r
+ \r
+@@ -412,7 +414,7 @@ function! s:set_defaults()\r
+ endif\r
+ endfunction\r
+ \r
+-function! s:NotMuch()\r
++function! s:NotMuch(...)\r
+ call s:set_defaults()\r
+ \r
+ ruby << EOF\r
+@@ -863,9 +865,13 @@ ruby << EOF\r
+ \r
+ get_config\r
+ EOF\r
+- call s:folders()\r
++ if a:0\r
++ call s:search(join(a:000))\r
++ else\r
++ call s:folders()\r
++ endif\r
+ endfunction\r
+ \r
+-command NotMuch :call s:NotMuch()\r
++command -nargs=* NotMuch call s:NotMuch(<f-args>)\r
+ \r
+ " vim: set noexpandtab:\r
+-- \r
+1.8.4.2+fc1\r
+\r