unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] completion: add proper completion of folder: and path:
@ 2014-03-12 20:33 Jani Nikula
  2014-03-12 20:33 ` [PATCH 2/2] completion: complete directory parameters to directories only Jani Nikula
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jani Nikula @ 2014-03-12 20:33 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-26  0:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-12 20:33 [PATCH 1/2] completion: add proper completion of folder: and path: Jani Nikula
2014-03-12 20:33 ` [PATCH 2/2] completion: complete directory parameters to directories only Jani Nikula
2014-03-24 21:14 ` [PATCH 1/2] completion: add proper completion of folder: and path: Tomi Ollila
2014-03-26  0:34 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).