Re: [PATCH 1/2] completion: add proper completion of folder: and path:
authorTomi Ollila <tomi.ollila@iki.fi>
Mon, 24 Mar 2014 21:14:14 +0000 (23:14 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:00:57 +0000 (10:00 -0800)
99/0b31240edb4c80df7e702115edc921246bfd69 [new file with mode: 0644]

diff --git a/99/0b31240edb4c80df7e702115edc921246bfd69 b/99/0b31240edb4c80df7e702115edc921246bfd69
new file mode 100644 (file)
index 0000000..3cf4f6e
--- /dev/null
@@ -0,0 +1,100 @@
+Return-Path: <tomi.ollila@iki.fi>\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 1D1F7431FBD\r
+       for <notmuch@notmuchmail.org>; Mon, 24 Mar 2014 14:14:26 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       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 pCo4PU9nb0Nv for <notmuch@notmuchmail.org>;\r
+       Mon, 24 Mar 2014 14:14:18 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id B4DF1431FB6\r
+       for <notmuch@notmuchmail.org>; Mon, 24 Mar 2014 14:14:18 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id 4B7FB1000E5;\r
+       Mon, 24 Mar 2014 23:14:14 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/2] completion: add proper completion of folder: and\r
+ path:\r
+In-Reply-To: <1394656429-1409-1-git-send-email-jani@nikula.org>\r
+References: <1394656429-1409-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.17+156~g1203750 (http://notmuchmail.org) Emacs/24.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Mon, 24 Mar 2014 23:14:14 +0200\r
+Message-ID: <m2ior3s3ix.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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, 24 Mar 2014 21:14:26 -0000\r
+\r
+On Wed, Mar 12 2014, Jani Nikula <jani@nikula.org> wrote:\r
+\r
+> Complete folder: to maildir folders and path: to directories in mail\r
+> store.\r
+> ---\r
+\r
+Series LGTM.\r
+\r
+\r
+Tomi\r
+\r
+\r
+COMPREPLY=( $(cd $path; compgen -d "${cur#path:}") ) might also work but...\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
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r