]> diplodocus.org Git - nmh/blobdiff - uip/show.c
add rmf(1) and folder(1) to one another's SEE ALSO sections
[nmh] / uip / show.c
index bd5282ba75f0ec108bc3a01036831de0a15f215c..4a53c914e581713097425813c8629711c36bd3de 100644 (file)
     X("nofmtproc", 0, NFMTPROCSW) \
     X("version", 0, VERSIONSW) \
     X("help", 0, HELPSW) \
     X("nofmtproc", 0, NFMTPROCSW) \
     X("version", 0, VERSIONSW) \
     X("help", 0, HELPSW) \
+    /*                         \
+     * switches for mhlproc    \
+     */                                \
+    X("concat", -6, CONCATSW) \
+    X("noconcat", -8, NCONCATSW) \
 
 #define X(sw, minchars, id) id,
 DEFINE_SWITCH_ENUM(SHOW);
 
 #define X(sw, minchars, id) id,
 DEFINE_SWITCH_ENUM(SHOW);
@@ -53,7 +58,7 @@ int
 main (int argc, char **argv)
 {
     int draftsw = 0, headersw = 1;
 main (int argc, char **argv)
 {
     int draftsw = 0, headersw = 1;
-    int nshow = 0, checkmime = 1, mime;
+    int nshow = 0, checkmime = 1, mime = 0;
     int isdf = 0, mode = SHOW, msgnum;
     char *cp, *maildir, *file = NULL, *folder = NULL, *proc, *program;
     char buf[BUFSIZ], **argp, **arguments;
     int isdf = 0, mode = SHOW, msgnum;
     char *cp, *maildir, *file = NULL, *folder = NULL, *proc, *program;
     char buf[BUFSIZ], **argp, **arguments;
@@ -61,13 +66,7 @@ main (int argc, char **argv)
     struct msgs_array msgs = { 0, 0, NULL };
     struct msgs_array vec = { 0, 0, NULL };
 
     struct msgs_array msgs = { 0, 0, NULL };
     struct msgs_array vec = { 0, 0, NULL };
 
-#ifdef LOCALE
-    setlocale(LC_ALL, "");
-#endif
-    invo_name = r1bindex (argv[0], '/');
-
-    /* read user profile/context */
-    context_read();
+    if (nmh_init(argv[0], 1)) { return 1; }
 
     if (!strcasecmp (invo_name, "next")) {
        mode = NEXT;
 
     if (!strcasecmp (invo_name, "next")) {
        mode = NEXT;
@@ -83,6 +82,13 @@ main (int argc, char **argv)
                case AMBIGSW: 
                    ambigsw (cp, switches);
                    done (1);
                case AMBIGSW: 
                    ambigsw (cp, switches);
                    done (1);
+
+               case CONCATSW:
+               case NCONCATSW:
+                   /* Use showmimeproc if one of these switches was
+                      specified because mhl doesn't understand them. */
+                   mime = 1;
+                   /* fall thru */
                case UNKWNSW: 
                case NPROGSW:
                case NFMTPROCSW:
                case UNKWNSW: 
                case NPROGSW:
                case NFMTPROCSW:
@@ -191,14 +197,6 @@ usage:
        goto go_to_it;
     }
 
        goto go_to_it;
     }
 
-#ifdef WHATNOW
-    if (!msgs.size && !folder && mode == SHOW && (cp = getenv ("mhdraft")) && *cp) {
-       draftsw++;
-       app_msgarg(&vec, cp);
-       goto go_to_it;
-    }
-#endif /* WHATNOW */
-
     if (!msgs.size) {
        switch (mode) {
            case NEXT:
     if (!msgs.size) {
        switch (mode) {
            case NEXT:
@@ -263,12 +261,11 @@ go_to_it: ;
     /*
      * Decide which "proc" to use
      */
     /*
      * Decide which "proc" to use
      */
-    mime = 0;
     if (nshow) {
        proc = catproc;
     } else {
        /* check if any messages are non-text MIME messages */
     if (nshow) {
        proc = catproc;
     } else {
        /* check if any messages are non-text MIME messages */
-       if (checkmime) {
+       if (! mime  &&  checkmime) {
            if (!draftsw && !file) {
                /* loop through selected messages and check for MIME */
                for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)
            if (!draftsw && !file) {
                /* loop through selected messages and check for MIME */
                for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)