summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-10-19 14:48:10 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-10-19 14:48:10 +0100
commit56cc97effa7b9f2d6a95f213587ced72a9ee3f7c (patch)
treec6db92495bc14ad9a959324faab3866623e2bf17 /alot
parentb46ca18b1e7d305b7ab591a89384c418f5a51ff9 (diff)
introduced option global.editor_in_thread
if set to True, alot will call your editor in a separate thread, making the ui non-blocking in case your editor uses its own x11 window.
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/globals.py8
-rw-r--r--alot/defaults/alot.rc5
2 files changed, 11 insertions, 2 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 4d825b78..807bee69 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -167,16 +167,20 @@ class ExternalCommand(Command):
#)
class EditCommand(ExternalCommand):
"""opens editor"""
- def __init__(self, path, spawn=None, **kwargs):
+ def __init__(self, path, spawn=None, thread=None, **kwargs):
self.path = path
if spawn != None:
self.spawn = spawn
else:
self.spawn = settings.config.getboolean('general', 'spawn_editor')
+ if thread != None:
+ self.thread = thread
+ else:
+ self.thread = settings.config.getboolean('general', 'editor_in_thread')
editor_cmd = settings.config.get('general', 'editor_cmd')
ExternalCommand.__init__(self, editor_cmd, path=self.path,
- spawn=self.spawn, thread=self.spawn,
+ spawn=self.spawn, thread=self.thread,
**kwargs)
diff --git a/alot/defaults/alot.rc b/alot/defaults/alot.rc
index 9fb80449..956e0409 100644
--- a/alot/defaults/alot.rc
+++ b/alot/defaults/alot.rc
@@ -43,6 +43,11 @@ show_statusbar = True
# use terminal_command to spawn a new terminal for the editor?
spawn_editor = False
+# call editor in separate thread.
+# in case your editor doesn't run in the same window as alot, setting true here
+# will make alot non-blocking during edits
+editor_in_thread = False
+
# set terminal for asynchronous editing
terminal_cmd = x-terminal-emulator -e