From c3648f08c7099e4ef120c8ce33c40eb0352c5acd Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 15 Jan 2016 18:35:05 +0100 Subject: Run pre-save and post-save hooks on reload Signed-off-by: Lukas Fleischer --- src/io.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/io.c b/src/io.c index 374f092..b0eca77 100644 --- a/src/io.c +++ b/src/io.c @@ -746,6 +746,14 @@ void io_reload_data(void) io_save_todo(path_todo_backup); io_save_mutex_unlock(); + /* + * We do not directly write to the data files here; + * however, the external merge tool might incorporate + * changes from the backup file into the main data + * files. + */ + run_hook("pre-save"); + if (!io_files_equal(path_apts, path_apts_backup)) { const char *arg_apts[] = { conf.mergetool, path_apts, @@ -764,6 +772,15 @@ void io_reload_data(void) xfree(path_apts_backup); xfree(path_todo_backup); + + /* + * We do not directly write to the data files here; + * however, the external merge tool will likely have + * incorporated changes from the backup file into the + * main data files at this point. + */ + run_hook("post-save"); + break; case 3: /* FALLTHROUGH */ -- cgit v1.2.3-70-g09d2