summaryrefslogtreecommitdiff
path: root/alot/commands/search.py
diff options
context:
space:
mode:
Diffstat (limited to 'alot/commands/search.py')
-rw-r--r--alot/commands/search.py19
1 files changed, 2 insertions, 17 deletions
diff --git a/alot/commands/search.py b/alot/commands/search.py
index 946749ec..3e172dd5 100644
--- a/alot/commands/search.py
+++ b/alot/commands/search.py
@@ -7,6 +7,7 @@ import logging
from . import Command, registerCommand
from .globals import PromptCommand
from .globals import MoveCommand
+from .common import RetagPromptCommand
from .. import commands
from .. import buffers
@@ -91,23 +92,7 @@ class RefinePromptCommand(Command):
return ui.apply_command(PromptCommand('refine ' + oldquery))
-@registerCommand(MODE, 'retagprompt')
-class RetagPromptCommand(Command):
-
- """prompt to retag selected threads\' tags"""
- def apply(self, ui):
- thread = ui.current_buffer.get_selected_thread()
- if not thread:
- return
- tags = []
- for tag in thread.get_tags():
- if ' ' in tag:
- tags.append('"%s"' % tag)
- # skip empty tags
- elif tag:
- tags.append(tag)
- initial_tagstring = ','.join(sorted(tags)) + ','
- return ui.apply_command(PromptCommand('retag ' + initial_tagstring))
+RetagPromptCommand = registerCommand(MODE, 'retagprompt')(RetagPromptCommand)
@registerCommand(