X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=init.c;h=eb92e1792e529b4195624dda37e6e206d12dd014;hp=bcb8139d7394a4cd74f368607b8a6c7842f7fed3;hb=06972cc96259a466cf14821d8b803bf3972d8fa2;hpb=a6f91e78d27906d413c9e53dc2ece06778e80412 diff --git a/init.c b/init.c index bcb8139..eb92e17 100644 --- a/init.c +++ b/init.c @@ -13,18 +13,18 @@ #include #include +#include #include #include - #include #include #include +#include #include "mutt.h" #include "keymap.h" #include "charset.h" #include "thread.h" -#include #include "mutt_idna.h" #if defined (USE_LIBESMTP) && (defined (USE_SSL) || defined (USE_GNUTLS)) @@ -2304,9 +2304,6 @@ static int mutt_execute_commands (string_list_t * p) return 0; } -#include "parse.h" -#include "rcparser.h" - void mutt_init (int skip_sys_rc, string_list_t * commands) { struct passwd *pw; @@ -2465,6 +2462,7 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) From = rfc822_parse_adrlist (NULL, p); charset_initialize(); + mlua_initialize(); /* Set standard defaults */ hash_map (ConfigOptions, mutt_set_default, 0); @@ -2536,6 +2534,15 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) exit (1); } + /* LUA {{{ */ + snprintf(buffer, sizeof(buffer), "%s/.madmutt.lua", NONULL(Homedir)); + if (access(buffer, F_OK) < 0) + snprintf(buffer, sizeof(buffer), "%s/.madmutt/cfg.lua", NONULL(Homedir)); + if (!access(buffer, F_OK)) { + need_pause = mlua_wrap(mutt_error, mlua_dofile(buffer)); + } + /* }}} */ + if (mutt_execute_commands (commands) != 0) need_pause = 1;