diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-09-16 22:00:55 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-09-22 10:32:39 +0100 |
commit | 593d64781343ddeba39b0892458172d0f9a2b5d5 (patch) | |
tree | 1d32b0c9d0c14351cec64d83bef8daf8fd82a7b4 /alot | |
parent | 18b42a7ceede0e82daec3d9a7e9abe8fd720328f (diff) |
prompt for initial tags when composing msg
This also adds a new config option `compose_ask_tags`
that defaults to False.
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/globals.py | 10 | ||||
-rw-r--r-- | alot/defaults/alot.rc.spec | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 5ff72c7f..900aea4e 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -23,6 +23,7 @@ from alot import helper from alot.db.errors import DatabaseLockedError from alot.completion import ContactsCompleter from alot.completion import AccountCompleter +from alot.completion import TagsCompleter from alot.db.envelope import Envelope from alot import commands from alot.settings import settings @@ -735,6 +736,15 @@ class ComposeCommand(Command): return self.envelope.add('Subject', subject) + if settings.get('compose_ask_tags'): + comp = TagsCompleter(ui.dbman) + tagsstring = yield ui.prompt('Tags', completer=comp) + tags = filter(lambda x: x, tagsstring.split(',')) + if tags is None: + ui.notify('canceled') + return + self.envelope.tags = tags + if self.attach: for gpath in self.attach: for a in glob.glob(gpath): diff --git a/alot/defaults/alot.rc.spec b/alot/defaults/alot.rc.spec index 73ecc95d..9506aa04 100644 --- a/alot/defaults/alot.rc.spec +++ b/alot/defaults/alot.rc.spec @@ -1,6 +1,9 @@ ask_subject = boolean(default=True) # ask for subject when compose +# prompt for initial tags when compose +compose_ask_tags = boolean(default=False) + # directory prefix for downloading attachments attachment_prefix = string(default='~') |