summaryrefslogtreecommitdiff
path: root/alot/completion
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-16 18:09:55 +0100
committerAnton Khirnov <anton@khirnov.net>2021-01-16 18:09:55 +0100
commit7e969f07bf378846ff9857e949f649dbe2fd2fe3 (patch)
tree43796cd874bff3c8cca97152a9611db640abe1b3 /alot/completion
parente420c1c60df5ca21a136a3e383e116ef5edcfd9e (diff)
completion/query: update keywords
Make them a class, rather than instance, attribute, since they are static. Update the list to include all the terms currently listed in notmuch-search-terms manual, skipping aliases 'is' and 'mid' (to avoid unnecessarily crowding the completion space).
Diffstat (limited to 'alot/completion')
-rw-r--r--alot/completion/query.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/alot/completion/query.py b/alot/completion/query.py
index 93d20527..d073fde3 100644
--- a/alot/completion/query.py
+++ b/alot/completion/query.py
@@ -17,7 +17,12 @@ class QueryCompleter(Completer):
_abookscompleter = None
_tagcompleter = None
_nquerycompleter = None
- _keywords = None
+
+ _KEYWORDS = (
+ 'body', 'from', 'to', 'subject', 'attachment', 'mimetype',
+ 'tag', 'id', 'thread', 'path', 'folder', 'date', 'lastmod',
+ 'query', 'property',
+ )
def __init__(self, dbman):
"""
@@ -28,8 +33,6 @@ class QueryCompleter(Completer):
self._abookscompleter = AbooksCompleter(abooks, addressesonly=True)
self._tagcompleter = TagCompleter(dbman)
self._nquerycompleter = NamedQueryCompleter(dbman)
- self._keywords = ['tag', 'from', 'to', 'subject', 'attachment',
- 'is', 'id', 'thread', 'folder', 'query']
def complete(self, original, pos):
mypart, start, end, mypos = self.relevant_part(original, pos)
@@ -54,7 +57,7 @@ class QueryCompleter(Completer):
resultlist.append((newtext, newpos))
return resultlist
else:
- matched = (t for t in self._keywords if t.startswith(myprefix))
+ matched = (t for t in self._KEYWORDS if t.startswith(myprefix))
resultlist = []
for keyword in matched:
newprefix = original[:start] + keyword + ':'