summaryrefslogtreecommitdiff
path: root/alot/commands/globals.py
diff options
context:
space:
mode:
authorLucas Hoffmann <l-m-h@web.de>2016-07-17 00:25:22 +0200
committerLucas Hoffmann <l-m-h@web.de>2016-12-14 08:46:01 +0100
commit9909249d8fb5f0581f4ae06eaacf399033795984 (patch)
tree4001cd0a40fba3e8f10ac872953591b3953a1bb7 /alot/commands/globals.py
parent466559bd6db90d98e65da327ed3e0ab78f0c858d (diff)
Expand history concept for sender and recipient of mail
Diffstat (limited to 'alot/commands/globals.py')
-rw-r--r--alot/commands/globals.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index eede876a..4626b3e2 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -765,10 +765,11 @@ class ComposeCommand(Command):
else:
cmpl = AccountCompleter()
fromaddress = yield ui.prompt('From', completer=cmpl,
- tab=1)
+ tab=1, history=ui.senderhistory)
if fromaddress is None:
raise CommandCanceled()
+ ui.senderhistory.append(fromaddress)
self.envelope.add('From', fromaddress)
# find out the right account
@@ -819,12 +820,14 @@ class ComposeCommand(Command):
append_remaining=allbooks)
logging.debug(abooks)
completer = ContactsCompleter(abooks)
- to = yield ui.prompt('To',
- completer=completer)
+ to = yield ui.prompt('To', completer=completer,
+ history=ui.recipienthistory)
if to is None:
raise CommandCanceled()
- self.envelope.add('To', to.strip(' \t\n,'))
+ to = to.strip(' \t\n,')
+ ui.recipienthistory.append(to)
+ self.envelope.add('To', to)
if settings.get('ask_subject') and \
'Subject' not in self.envelope.headers: