summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-10-18 14:56:43 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-10-18 14:56:43 +0100
commitbee3b9d6b834c152082f9dd4e1de4aea39647616 (patch)
tree3a08c83173e29f2645eda27484181cbd371a5cbe
parent2abe2e3f6ab3ab13eb9af05736eadbe18fcd6de4 (diff)
unset command in envelope buffer
-rw-r--r--alot/commands/envelope.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 7813c130..38211c6c 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -221,3 +221,16 @@ class EnvelopeSetCommand(Command):
mail[self.key] = self.value
envelope.set_email(mail)
envelope.rebuild()
+
+
+@registerCommand(MODE, 'unset', help='remove header field', arguments=[
+ (['key'], {'help':'header to refine'})])
+class EnvelopeSetCommand(Command):
+ def __init__(self, key, **kwargs):
+ self.key = key
+ Command.__init__(self, **kwargs)
+
+ def apply(self, ui):
+ mail = ui.current_buffer.get_email()
+ del(mail[self.key])
+ ui.current_buffer.set_email(mail)