summaryrefslogtreecommitdiff
path: root/alot/commands/thread.py
diff options
context:
space:
mode:
Diffstat (limited to 'alot/commands/thread.py')
-rw-r--r--alot/commands/thread.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py
index de948747..1da58560 100644
--- a/alot/commands/thread.py
+++ b/alot/commands/thread.py
@@ -483,7 +483,6 @@ class EditNewCommand(Command):
tags = set(self.message.get_tags())
tags.difference_update({'inbox', 'sent', 'draft', 'killed', 'replied',
'signed', 'encrypted', 'unread', 'attachment'})
- tags = list(tags)
# set body text
mailcontent = self.message.get_body_text()
envelope = Envelope(bodytext=mailcontent, tags=tags)
@@ -1078,7 +1077,7 @@ class TagCommand(Command):
else:
messages = [ui.current_buffer.get_selected_message()]
- tags = [t for t in self.tagsstring.split(',') if t]
+ tags = frozenset(filter(None, self.tagsstring.split(',')))
try:
for m in messages:
if self.action == 'add':
@@ -1088,13 +1087,13 @@ class TagCommand(Command):
elif self.action == 'remove':
m.remove_tags(tags)
elif self.action == 'toggle':
- to_remove = []
- to_add = []
+ to_remove = set()
+ to_add = ()
for t in tags:
if t in m.get_tags():
- to_remove.append(t)
+ to_remove.add(t)
else:
- to_add.append(t)
+ to_add.add(t)
m.remove_tags(to_remove)
m.add_tags(to_add)