From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 3E6E8431FC7 for ; Mon, 10 Nov 2014 11:35:58 -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 z+cGLggpDmq7 for ; Mon, 10 Nov 2014 11:35:52 -0800 (PST) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 80B01431FBF for ; Mon, 10 Nov 2014 11:35:52 -0800 (PST) Received: by mail-wi0-f176.google.com with SMTP id h11so11718988wiw.3 for ; Mon, 10 Nov 2014 11:35:51 -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=Zu8xQzYHtDe7lGamzuky1trZjt1j7ll7rb9PlgeyDa4=; b=GdBalZc7R+UL1kQcHIsxkOyWwP2Q9ll9Hu6mM2jdrNnFmx2T/7aSezDD7Nc4nGC4PU Kpjnq+N6AknDGXQDX3AyYZHs1jVIVfK3xinRpPQ8hVl4yHtQzr+m61ilZVYyejsV5g4w qqzHP8I3uSGjUUD1IKC51mw7IV+KpO9PAa5jSy+fs4YGZ0+/2iTBRADaw2LRDACEjVYn PnFQ2jo8HVpD37PbFtaak8DhmuHUwvAvL7ergQrz64NlB4Ij3OSrsaEBuMlXsewUgiDS csFQukA6bz0nwCU9qPdNH2CZV5KgqdWceNStWu8fwBhVht5GyEMBY52ajZoN66BsI3D0 60qw== X-Gm-Message-State: ALoCoQkV3KiDujmcELHYJONOrFbRT/fxwLe7GD6l8WiLEXwAy2AcdBoOWw+xXnkdxgX5b6wWxK86 X-Received: by 10.194.59.17 with SMTP id v17mr7625445wjq.130.1415648151529; Mon, 10 Nov 2014 11:35:51 -0800 (PST) Received: from localhost (dsl-hkibrasgw2-58c36d-48.dhcp.inet.fi. [88.195.109.48]) by mx.google.com with ESMTPSA id s10sm18616154wjw.29.2014.11.10.11.35.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Nov 2014 11:35:50 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 2/2] completion: complete notmuch insert --folder to maildir folders only Date: Mon, 10 Nov 2014 21:35:43 +0200 Message-Id: <1415648143-19923-2-git-send-email-jani@nikula.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1415648143-19923-1-git-send-email-jani@nikula.org> References: <1415648143-19923-1-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: Mon, 10 Nov 2014 19:35:58 -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..a756b22339cb 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##folder:}" | \ + sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$" ) ) return ;; esac -- 2.1.1