summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2018-06-23 12:51:00 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2018-07-24 22:05:56 +0100
commit0a0b21fab575fdf4cca01ef7a7b1e95ad7125c89 (patch)
tree8513d3993a43f2915488dc1be8dba575f8c4b2c7 /alot
parent03dfceb88c102f1763672f0456456b556ebb23b0 (diff)
add global namedqueries command
... that opens a new namedqueries buffer
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/__init__.py1
-rw-r--r--alot/commands/globals.py15
2 files changed, 16 insertions, 0 deletions
diff --git a/alot/commands/__init__.py b/alot/commands/__init__.py
index ddd7ed17..c1662073 100644
--- a/alot/commands/__init__.py
+++ b/alot/commands/__init__.py
@@ -38,6 +38,7 @@ COMMANDS = {
'envelope': {},
'bufferlist': {},
'taglist': {},
+ 'namedqueries': {},
'thread': {},
'global': {},
}
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 06d0d5ce..af98694d 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -553,6 +553,21 @@ class TagListCommand(Command):
ui.buffer_open(buffers.TagListBuffer(ui, tags, self.filtfun))
+@registerCommand(MODE, 'namedqueries')
+class NamedQueriesCommand(Command):
+ """opens named queries buffer"""
+ def __init__(self, filtfun=bool, **kwargs):
+ """
+ :param filtfun: filter to apply to displayed list
+ :type filtfun: callable (str->bool)
+ """
+ self.filtfun = filtfun
+ Command.__init__(self, **kwargs)
+
+ def apply(self, ui):
+ ui.buffer_open(buffers.NamedQueriesBuffer(ui, self.filtfun))
+
+
@registerCommand(MODE, 'flush')
class FlushCommand(Command):