X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=main.c;h=cc432d924b87c758346ab04b22307ff2f12fd9e2;hp=62474293933902f1ea82b18f0aa5f0faa7747af3;hb=6605e3e4bf358e8d5835232623dc359af219cc6a;hpb=cfd5f411041c7ef44087b032751792fadc74586d diff --git a/main.c b/main.c index 6247429..cc432d9 100644 --- a/main.c +++ b/main.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -46,8 +47,8 @@ extern int optind; #endif #ifdef USE_HCACHE -#if defined(HAVE_QDBM) -#include +#if defined(HAVE_TOKYOCABINET) +#include #elif defined(HAVE_GDBM) #include #endif @@ -56,6 +57,8 @@ extern int optind; #include #include +#include + void mutt_exit(int code) { mutt_endwin(NULL); @@ -64,7 +67,7 @@ void mutt_exit(int code) static void mutt_usage (void) { - puts(mutt_make_version()); + puts(madmutt_version); puts(_("\ usage: madmutt [ -nRyzZ ] [ -e ] [ -F ] [ -f ]\n\ @@ -86,7 +89,6 @@ usage: madmutt [ -nRyzZ ] [ -e ] [ -F ] [ -f ]\n\ puts(_(" -R open mailbox in read-only mode")); puts(_(" -s specify a subject (must be in quotes if it has spaces)")); puts(_(" -v show version and compile-time definitions")); - puts(_(" -y select a mailbox specified in your `mailboxes' list")); puts(_(" -z exit immediately if there are no messages in the mailbox")); puts(_(" -Z open the first folder with new message, exit immediately if none")); puts(_(" -h this help message")); @@ -99,7 +101,7 @@ static void show_version (void) struct utsname uts; uname(&uts); - puts(mutt_make_version()); + puts(madmutt_version); puts(_(" Copyright (C) 1996-2002 Michael R. Elkins and others.")); puts(_(" Copyright (C) 2005 The Mutt-ng Team")); puts(_(" Copyright (C) 2006-2007 Pierre Habouzit")); @@ -119,8 +121,8 @@ static void show_version (void) printf(" libidn %s\n", STRINGPREP_VERSION); #endif #ifdef USE_HCACHE -#if defined(HAVE_QDBM) - printf(" qdbm %s\n", dpversion); +#if defined(HAVE_TOKYOCABINET) + printf(" tokyocabinet %s\n", tcversion); #elif defined(HAVE_GDBM) printf(" gdbm %s\n", gdbm_version); #endif @@ -130,16 +132,6 @@ static void show_version (void) puts (_("Compile Options:")); puts ( -#ifdef USE_FCNTL - " +USE_FCNTL" -#else - " -USE_FCNTL" -#endif -#ifdef USE_FLOCK - " +USE_FLOCK" -#else - " -USE_FLOCK" -#endif #ifdef USE_HCACHE " +USE_HCACHE" #else @@ -171,8 +163,6 @@ static void show_version (void) #define M_BUFFY (1<<1) /* -Z */ #define M_NOSYSRC (1<<2) /* -n */ #define M_RO (1<<3) /* -R */ -#define M_SELECT (1<<4) /* -y */ -#define M_NEWS (1<<5) /* -g and -G */ __attribute__((format(printf, 1, 0))) static void mutt_nocurses_error (const char *fmt, ...) @@ -219,7 +209,7 @@ int main (int argc, char **argv) srand48 (time (NULL)); umask (077); - while ((i = getopt(argc, argv, "a:b:F:f:c:e:H:s:i:hnpRTtvyzZ")) >= 0) + while ((i = getopt(argc, argv, "a:b:F:f:c:e:H:s:i:hnpRTtvzZ")) >= 0) switch (i) { case 'a': if (strlen(optarg)<=512) @@ -283,10 +273,6 @@ int main (int argc, char **argv) version++; break; - case 'y': /* My special hack mode */ - flags |= M_SELECT; - break; - case 'z': flags |= M_IGNORE; break; @@ -318,6 +304,7 @@ int main (int argc, char **argv) } /* set defaults and read init files */ + el_initialize(); mutt_init (flags & M_NOSYSRC, commands); string_list_wipe(&commands); @@ -479,20 +466,6 @@ int main (int argc, char **argv) folder[0] = 0; buffy_next (folder, sizeof (folder)); } - else if (flags & M_SELECT) { - if (!Incoming.len) { - mutt_endwin _("No incoming mailboxes defined."); - - exit (1); - } - folder[0] = 0; - mutt_select_file(folder, sizeof(folder), M_SEL_FOLDER | M_SEL_BUFFY, - NULL, NULL); - if (!folder[0]) { - mutt_endwin (NULL); - exit (0); - } - } if (!folder[0]) m_strcpy(folder, sizeof(folder), NONULL(Spoolfile)); @@ -519,6 +492,7 @@ int main (int argc, char **argv) NULL)) || !explicit_folder) { mutt_index_menu (); + if (option (OPTXTERMSETTITLES)) printf("\033]2;%s\007", NONULL(XtermLeave)); if (Context) @@ -529,5 +503,6 @@ int main (int argc, char **argv) luaM_shutdown(); mutt_sasl_shutdown(); + el_shutdown(); exit (0); }