From: Jani Nikula Date: Thu, 1 Jan 2015 14:34:30 +0000 (+0200) Subject: [PATCH v2] completion: complete notmuch insert --folder to maildir folders only X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1e5dac369c1352895563aac0a844cb356e95627c;p=notmuch-archives.git [PATCH v2] completion: complete notmuch insert --folder to maildir folders only --- diff --git a/ec/ab06ef0dc28b636354212e1c228f0ace3d19b0 b/ec/ab06ef0dc28b636354212e1c228f0ace3d19b0 new file mode 100644 index 000000000..52afc1f23 --- /dev/null +++ b/ec/ab06ef0dc28b636354212e1c228f0ace3d19b0 @@ -0,0 +1,91 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 88911431FCB + for ; Thu, 1 Jan 2015 06:34:28 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id wQm6D63yiOOM for ; + Thu, 1 Jan 2015 06:34:25 -0800 (PST) +Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com + [209.85.212.182]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 1B031431FC0 + for ; Thu, 1 Jan 2015 06:34:25 -0800 (PST) +Received: by mail-wi0-f182.google.com with SMTP id h11so26668901wiw.9 + for ; Thu, 01 Jan 2015 06:34:22 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to + :references; + bh=htE6h2g+eUYNuT1r2DZHe3TviNUn8x+z9n88Lw2hySw=; + b=M6OiCsyjsYMIlPOWphwKiZf99Y81QjyX9GKPgRH3Vmhxy1u3szcFbZxm72RmlItmz3 + RqKScsTl8g0MP2cN3Igdg3m3ZE8QXSkGEb9V3QF+nDPPKutLdq4owpQiFImM190mmnU/ + TsKzPJBKze0KtXYd+xfcO3M+fxIbfF8g3VgRl1G33Mr04u7a5bkeh7pMskFUt7dkIfZ8 + FV+58QqJM2ZrYiqngrm+TYOGKPEawyz7Ihjf3BlIh6FcZwFWrj+XfbMgYBbIbFlJmE23 + fZyOdhUio8R9dvC02VbT0z8ZiPZYe9eGml9gA61Ph4wbs/7gcbOdqqu7kWItTBxfcD71 + IYwQ== +X-Gm-Message-State: + ALoCoQm2YXKPNYdq0PP/3/bhXfXrWfkVrQsIv1I2rS3Q/uiIIm6KYmk5UlAjADmEuAiDwAEy/iCd +X-Received: by 10.194.246.167 with SMTP id + xx7mr141234961wjc.118.1420122862837; Thu, 01 Jan 2015 06:34:22 -0800 (PST) +Received: from localhost (dsl-hkibrasgw2-58c371-91.dhcp.inet.fi. + [88.195.113.91]) by mx.google.com with ESMTPSA id + dc1sm45933654wib.18.2015.01.01.06.34.21 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 01 Jan 2015 06:34:22 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH v2] completion: complete notmuch insert --folder to maildir + folders only +Date: Thu, 1 Jan 2015 16:34:30 +0200 +Message-Id: <1420122870-13134-1-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <1415648143-19923-2-git-send-email-jani@nikula.org> +References: <1415648143-19923-2-git-send-email-jani@nikula.org> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 01 Jan 2015 14:34:28 -0000 + +The --folder option expects a folder relative from maildir root, so +complete like the folder: search term. +--- + completion/notmuch-completion.bash | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash +index 386437333742..d58dc8bed60f 100644 +--- a/completion/notmuch-completion.bash ++++ b/completion/notmuch-completion.bash +@@ -188,7 +188,10 @@ _notmuch_insert() + $split && + case "${prev}" in + --folder) +- _filedir ++ local path=`notmuch config get database.path` ++ compopt -o nospace ++ COMPREPLY=( $(compgen -d "$path/${cur}" | \ ++ sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$" ) ) + return + ;; + esac +-- +2.1.4 +