summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpazz <patricktotzke@gmail.com>2011-07-30 13:11:24 +0100
committerpazz <patricktotzke@gmail.com>2011-07-30 13:11:24 +0100
commit6a98a65efc69e8b49195faff9b5e455dc45f29aa (patch)
tree5f44ed83bcc7af73e54dff838227c051dc9eb24d
parent71730badf4494dcf77e55ec7ca10723dd9be531f (diff)
select in taglist works again. issue #52
-rw-r--r--alot/command.py9
-rw-r--r--alot/commandfactory.py7
-rw-r--r--alot/settings.py3
3 files changed, 15 insertions, 4 deletions
diff --git a/alot/command.py b/alot/command.py
index d8ccc30b..dbf6cee2 100644
--- a/alot/command.py
+++ b/alot/command.py
@@ -546,4 +546,13 @@ class BounceMailCommand(Command):
mail = msg.get_email()
del(mail['To'])
ui.apply_command(ComposeCommand(mail=mail))
+
+### taglist
+class TaglistSelectCommand(Command):
+ def apply(self, ui):
+ tagstring = ui.current_buffer.get_selected_tag()
+ cmd = SearchCommand(query='tag:%s' % tagstring)
+ ui.apply_command(cmd)
+
+
import envelope
diff --git a/alot/commandfactory.py b/alot/commandfactory.py
index 490b6a4b..2c58de4a 100644
--- a/alot/commandfactory.py
+++ b/alot/commandfactory.py
@@ -59,6 +59,9 @@ COMMANDS = {
'reply': (command.ReplyCommand, {}),
'groupreply': (command.ReplyCommand, {'groupreply': True}),
'bounce': (command.BounceMailCommand, {}),
+
+ # taglist
+ 'select': (command.TaglistSelectCommand, {}),
}
@@ -112,7 +115,7 @@ ALLOWED_COMMANDS = {
'retagprompt'] + globalcomands,
'envelope': ['send', 'reedit', 'to', 'subject'] + globalcomands,
'bufferlist': ['openfocussed', 'closefocussed'] + globalcomands,
- 'taglist': globalcomands,
+ 'taglist': ['select'] + globalcomands,
'thread': ['toggletag', 'reply', 'groupreply', 'bounce'] + globalcomands,
}
@@ -147,7 +150,7 @@ def interpret_commandline(cmdline, mode):
'openfocussed', 'closefocussed', 'bnext', 'bprevious',
'retag', 'refresh', 'bufferlist', 'refineprompt', 'reply',
'groupreply', 'bounce', 'openthread', 'send', 'reedit',
- 'retagprompt']:
+ 'select', 'retagprompt']:
return commandfactory(cmd)
else:
return None
diff --git a/alot/settings.py b/alot/settings.py
index 1663e94f..d23b4bfa 100644
--- a/alot/settings.py
+++ b/alot/settings.py
@@ -319,8 +319,7 @@ MAPPING = {
'g': ('groupreply', ''),
},
'taglist': {
- # 'enter': ('search', {'query': (lambda: 'tag:' +
- # self.get_selected_tag())}),
+ 'enter': ('select', ''),
},
'envelope': {
'y': ('send', ''),