X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=init.c;h=1c870b5745dc4200c3bc348b165a3f2b1224834b;hp=3573ff91cfb83fc2f2cdcb212a2b586035c23031;hb=62781e50bfc69cf85be21ec9a18aeb32ef789952;hpb=0f44dc85fc1280372ffab911d701e703d803fb4b diff --git a/init.c b/init.c index 3573ff9..1c870b5 100644 --- a/init.c +++ b/init.c @@ -27,7 +27,6 @@ #include "mx.h" #include "init.h" -#include "mailbox.h" #include "lib/mem.h" #include "lib/intl.h" @@ -42,6 +41,8 @@ #include #include +list2_t* Synonyms; + void toggle_quadoption (int opt) { int n = opt / 4; @@ -92,9 +93,12 @@ int mutt_option_index (char *s) int i; for (i = 0; MuttVars[i].option; i++) - if (safe_strcmp (s, MuttVars[i].option) == 0) + if (safe_strcmp (s, MuttVars[i].option) == 0) { + if (MuttVars[i].type == DT_SYN) + list_push_back (&Synonyms, &MuttVars[i]); return (MuttVars[i].type == DT_SYN ? mutt_option_index ((char *) MuttVars[i].data) : i); + } return (-1); } @@ -2283,6 +2287,19 @@ void mutt_init (int skip_sys_rc, LIST * commands) if (mutt_execute_commands (commands) != 0) need_pause = 1; + /* warn about synonym variables */ + if (!list_empty(Synonyms)) { + int i = 0; + fprintf (stderr, _("Warning: the following synonym variables were found:\n")); + for (i = 0; i < Synonyms->length; i++) + fprintf (stderr, "$%s ($%s should be used)\n", + ((struct option_t*) Synonyms->data[i])->option, + (char*) ((struct option_t*) Synonyms->data[i])->data); + fprintf (stderr, _("Warning: Synonym variables are scheduled for removal.\n")); + list_del (&Synonyms, NULL); + need_pause = 1; + } + if (need_pause && !option (OPTNOCURSES)) { if (mutt_any_key_to_continue (NULL) == -1) mutt_exit (1);