From 206500a739d55f6e873bfb6faae00a1b461bd3e4 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Wed, 12 Mar 2014 22:33:48 +0200 Subject: [PATCH] [PATCH 1/2] completion: add proper completion of folder: and path: --- ef/b29661defee83a8a7366766114f76e792ad1a6 | 97 +++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 ef/b29661defee83a8a7366766114f76e792ad1a6 diff --git a/ef/b29661defee83a8a7366766114f76e792ad1a6 b/ef/b29661defee83a8a7366766114f76e792ad1a6 new file mode 100644 index 000000000..75c47e51d --- /dev/null +++ b/ef/b29661defee83a8a7366766114f76e792ad1a6 @@ -0,0 +1,97 @@ +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 8BE4E431FC2 + for ; Wed, 12 Mar 2014 13:34:00 -0700 (PDT) +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 LdTbzG44Vehg for ; + Wed, 12 Mar 2014 13:33:55 -0700 (PDT) +Received: from mail-ea0-f178.google.com (mail-ea0-f178.google.com + [209.85.215.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id D9EBF431FAE + for ; Wed, 12 Mar 2014 13:33:54 -0700 (PDT) +Received: by mail-ea0-f178.google.com with SMTP id a15so88446eae.9 + for ; Wed, 12 Mar 2014 13:33:52 -0700 (PDT) +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; + bh=hvVTFdmAUxWnprdLjO0d7bYMiHWBOiGLekQp/jIe3Hs=; + b=ZZcZvQDeRmV+ilbwyRvmZF3RmvMzpztDuojSA6/zJXoDm17eK8AWDHtTaAzqVu0s0h + kcZQZkats4wIeH5rYo9uSYY8HC0UtF8BdbfW4erV1JMl9HC5iI9pVsBTh1FGbzvscr26 + 1sReCfsnlLzO0IJGMR2KUNPNQn3Wacxyl8bwg/RIUqrJPIFrvhKkJeD+rEjB3sIn+562 + cqInaMvw5/ycecsf14cqOUH9mGAhUT/x9yAnjXVFDYoJesMkaxmiL2HXU0MOlk+FLm6m + xWcDHGqBiiTk8RbCcKPZEESgcP34bG/6RkUL3UtUmld/b5OmWH12eDIWrKGhCoFL1bVs + Qwew== +X-Gm-Message-State: + ALoCoQnfCB4yjfwyi0m74xsWj7QxvaOFJdKptxNm9R4ETHvqXl6rlV2BXJTn6gBvYc/poGsZEsU9 +X-Received: by 10.14.200.194 with SMTP id z42mr69763een.112.1394656432133; + Wed, 12 Mar 2014 13:33:52 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) + by mx.google.com with ESMTPSA id f45sm20973eeg.5.2014.03.12.13.33.50 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Wed, 12 Mar 2014 13:33:51 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH 1/2] completion: add proper completion of folder: and path: +Date: Wed, 12 Mar 2014 22:33:48 +0200 +Message-Id: <1394656429-1409-1-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 1.9.0 +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: Wed, 12 Mar 2014 20:34:00 -0000 + +Complete folder: to maildir folders and path: to directories in mail +store. +--- + completion/notmuch-completion.bash | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash +index 0f132043dea5..59f1a3ea6431 100644 +--- a/completion/notmuch-completion.bash ++++ b/completion/notmuch-completion.bash +@@ -49,8 +49,19 @@ _notmuch_search_terms() + from:*) + COMPREPLY=( $(compgen -P "from:" -W "`_notmuch_user_emails`" -- ${cur##from:}) ) + ;; ++ path:*) ++ local path=`notmuch config get database.path` ++ compopt -o nospace ++ COMPREPLY=( $(compgen -d "$path/${cur##path:}" | sed "s|^$path/||" ) ) ++ ;; ++ folder:*) ++ local path=`notmuch config get database.path` ++ compopt -o nospace ++ COMPREPLY=( $(compgen -d "$path/${cur##folder:}" | \ ++ sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$" ) ) ++ ;; + *) +- local search_terms="from: to: subject: attachment: tag: id: thread: folder: date:" ++ local search_terms="from: to: subject: attachment: tag: id: thread: folder: path: date:" + compopt -o nospace + COMPREPLY=( $(compgen -W "${search_terms}" -- ${cur}) ) + ;; +-- +1.9.0 + -- 2.26.2