[PATCH 1/2] completion: add proper completion of folder: and path:
authorJani Nikula <jani@nikula.org>
Wed, 12 Mar 2014 20:33:48 +0000 (22:33 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:00:44 +0000 (10:00 -0800)
ef/b29661defee83a8a7366766114f76e792ad1a6 [new file with mode: 0644]

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