summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-06-16 15:57:25 -0700
committerDylan Baker <dylan@pnwbakers.com>2017-07-10 17:04:06 -0700
commitb4cb1bd2692277b3d722733dfcca1322ffb6d45a (patch)
treec51bf988965fcda546ea97547d49e026b5887665
parent86186a242c11fcbc501e7afc791a50187e0dd574 (diff)
Add a reload command
This command allows the configuration to be reloaded while alot is running. Fixes #1046
-rw-r--r--NEWS3
-rw-r--r--alot/commands/globals.py9
-rw-r--r--docs/source/usage/modes/global.rst7
3 files changed, 19 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 3c833974..2b2855d0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+next:
+* Add command to reload configuration files in running session
+
0.5:
* save command prompt, recipient and sender history across program restarts
* new config option: "handle_mouse" to enable interpretation of mouse events
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index fcd92e97..8e8c4fde 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -955,3 +955,12 @@ class MoveCommand(Command):
else:
ui.notify('unknown movement: ' + self.movement,
priority='error')
+
+
+@registerCommand(MODE, 'reload', help='Reload all configuration files')
+class ReloadCommand(Command):
+
+ """Reload configuration."""
+
+ def apply(self, ui):
+ settings.reload()
diff --git a/docs/source/usage/modes/global.rst b/docs/source/usage/modes/global.rst
index 066acde7..6e99478b 100644
--- a/docs/source/usage/modes/global.rst
+++ b/docs/source/usage/modes/global.rst
@@ -104,6 +104,13 @@ The following commands are available globally
refresh the current buffer
+.. _cmd.global.reload:
+
+.. describe:: reload
+
+ Reload all configuration files
+
+
.. _cmd.global.pyshell:
.. describe:: pyshell