--- /dev/null
+Return-Path: <jani@nikula.org>\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 3E6E8431FC7\r
+ for <notmuch@notmuchmail.org>; Mon, 10 Nov 2014 11:35:58 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[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 z+cGLggpDmq7 for <notmuch@notmuchmail.org>;\r
+ Mon, 10 Nov 2014 11:35:52 -0800 (PST)\r
+Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com\r
+ [209.85.212.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 80B01431FBF\r
+ for <notmuch@notmuchmail.org>; Mon, 10 Nov 2014 11:35:52 -0800 (PST)\r
+Received: by mail-wi0-f176.google.com with SMTP id h11so11718988wiw.3\r
+ for <notmuch@notmuchmail.org>; Mon, 10 Nov 2014 11:35:51 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+ :references;\r
+ bh=Zu8xQzYHtDe7lGamzuky1trZjt1j7ll7rb9PlgeyDa4=;\r
+ b=GdBalZc7R+UL1kQcHIsxkOyWwP2Q9ll9Hu6mM2jdrNnFmx2T/7aSezDD7Nc4nGC4PU\r
+ Kpjnq+N6AknDGXQDX3AyYZHs1jVIVfK3xinRpPQ8hVl4yHtQzr+m61ilZVYyejsV5g4w\r
+ qqzHP8I3uSGjUUD1IKC51mw7IV+KpO9PAa5jSy+fs4YGZ0+/2iTBRADaw2LRDACEjVYn\r
+ PnFQ2jo8HVpD37PbFtaak8DhmuHUwvAvL7ergQrz64NlB4Ij3OSrsaEBuMlXsewUgiDS\r
+ csFQukA6bz0nwCU9qPdNH2CZV5KgqdWceNStWu8fwBhVht5GyEMBY52ajZoN66BsI3D0\r
+ 60qw==\r
+X-Gm-Message-State:\r
+ ALoCoQkV3KiDujmcELHYJONOrFbRT/fxwLe7GD6l8WiLEXwAy2AcdBoOWw+xXnkdxgX5b6wWxK86\r
+X-Received: by 10.194.59.17 with SMTP id v17mr7625445wjq.130.1415648151529;\r
+ Mon, 10 Nov 2014 11:35:51 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw2-58c36d-48.dhcp.inet.fi.\r
+ [88.195.109.48]) by mx.google.com with ESMTPSA id\r
+ s10sm18616154wjw.29.2014.11.10.11.35.50 for <multiple recipients>\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Mon, 10 Nov 2014 11:35:50 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] completion: complete notmuch insert --folder to maildir\r
+ folders only\r
+Date: Mon, 10 Nov 2014 21:35:43 +0200\r
+Message-Id: <1415648143-19923-2-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 2.1.1\r
+In-Reply-To: <1415648143-19923-1-git-send-email-jani@nikula.org>\r
+References: <1415648143-19923-1-git-send-email-jani@nikula.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: Mon, 10 Nov 2014 19:35:58 -0000\r
+\r
+The --folder option expects a folder relative from maildir root, so\r
+complete like the folder: search term.\r
+---\r
+ completion/notmuch-completion.bash | 5 ++++-\r
+ 1 file changed, 4 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash\r
+index 386437333742..a756b22339cb 100644\r
+--- a/completion/notmuch-completion.bash\r
++++ b/completion/notmuch-completion.bash\r
+@@ -188,7 +188,10 @@ _notmuch_insert()\r
+ $split &&\r
+ case "${prev}" in\r
+ --folder)\r
+- _filedir\r
++ local path=`notmuch config get database.path`\r
++ compopt -o nospace\r
++ COMPREPLY=( $(compgen -d "$path/${cur##folder:}" | \\r
++ sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$" ) )\r
+ return\r
+ ;;\r
+ esac\r
+-- \r
+2.1.1\r
+\r