From b4cb1bd2692277b3d722733dfcca1322ffb6d45a Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 16 Jun 2017 15:57:25 -0700 Subject: Add a reload command This command allows the configuration to be reloaded while alot is running. Fixes #1046 --- NEWS | 3 +++ alot/commands/globals.py | 9 +++++++++ docs/source/usage/modes/global.rst | 7 +++++++ 3 files changed, 19 insertions(+) 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 -- cgit v1.2.3