]> git.marmaro.de Git - mmh/commitdiff
Make default scan/inc listing file-based
authormarkus schnalke <meillo@marmaro.de>
Wed, 20 Apr 2016 06:19:24 +0000 (08:19 +0200)
committermarkus schnalke <meillo@marmaro.de>
Thu, 21 Apr 2016 08:07:59 +0000 (10:07 +0200)
There's now a new format file etc/scan.default, which contains
the default scan listing. Previously it was hard-coded as a define
in h/scansbr.h. The default scan listing format can be set in
config/config.h and can be queried with `mhparam scanformat'.

config/config.c
etc/Makefile.in
etc/scan.default [new file with mode: 0644]
h/mh.h
h/scansbr.h
uip/fmtdump.c
uip/inc.c
uip/mhparam.c
uip/scan.c

index 2bf7325bb42e4579de76906f36bb7cc4e44c7aca..5e250414946e3686b97a1a1253c1558109566c0a 100644 (file)
@@ -62,6 +62,7 @@ char *digestcomps    = "digestcomps";      /* forw -digest */
 /* standard format (filter) files */
 char *mhlformat      = "mhl.format";       /* show         */
 char *mhlreply       = "mhl.reply";        /* repl         */
+char *scanformat     = "scan.default";     /* scan/inc     */
 
 
 /*
index da3bb51aa08b96145f45007cec5df7afddb9dba4..fd00e0de39376ba381358b819fc00300809b5f31 100644 (file)
@@ -31,7 +31,8 @@ STATIC_FILES = components digestcomps distcomps forwcomps \
                mhl.reply rcvdistcomps rcvdistcomps.outbox \
                replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
                scan.nmh scan.mailx scan.nomime scan.size scan.time \
-               scan.timely scan.unseen scan.meillo mhn.defaults
+               scan.timely scan.unseen scan.meillo scan.default \
+               mhn.defaults
 
 # ========= DEPENDENCIES FOR BUILDING ==========
 
diff --git a/etc/scan.default b/etc/scan.default
new file mode 100644 (file)
index 0000000..902998a
--- /dev/null
@@ -0,0 +1,8 @@
+%;
+%; default scan/inc listing format
+%;
+%4(msg)%<(cur)+%| %>%<{replied}-%| %>\
+%4(year{date})-%02(mon{date})-%02(mday{date}) \
+%02(hour{date}):%02(min{date})  \
+%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
+%<(zero)%17(decode(friendly{from}))%>  %(decode{subject})
diff --git a/h/mh.h b/h/mh.h
index 33b38eef7fb4d75a8d6dba5cf727fd725375f7cd..a5a12ce2784911f6a1a777b6e440e9f2a215dda5 100644 (file)
--- a/h/mh.h
+++ b/h/mh.h
@@ -281,6 +281,7 @@ extern char *psequence;
 extern char *rcvdistcomps;
 extern char *replcomps;
 extern char *replgroupcomps;
+extern char *scanformat;
 extern char *sendmail;
 extern char *seq_all;
 extern char *seq_beyond;
index 91b2ff676749aa45e763abe39eb286fa9d5e260f..5e5816d94351b47c552eb42fd8deee443c3c2273 100644 (file)
@@ -10,15 +10,6 @@ extern char *scanl;
 #define SCNNUM  (-2)  /* number out of range                  */
 #define SCNFAT  (-3)  /* fatal error                          */
 
-/*
-** default format for `scan' and `inc'
-*/
-# define FORMAT \
-"=%4(msg)%<(cur)+%| %>%<{replied}-%| %>\
-%4(year{date})-%02(mon{date})-%02(mday{date}) %02(hour{date}):%02(min{date})  \
-%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
-%<(zero)%17(decode(friendly{from}))%>  %(decode{subject})\n"
-
 #define WIDTH  78
 
 #define SCN_MBOX (-1)
index 5266235a5dd39eb145307fbc72f9b64d16065749..a91333b7d2a3ecbdfa0524c012bb8eace75809b2 100644 (file)
@@ -89,10 +89,8 @@ main(int argc, char **argv)
                        form = cp;
        }
 
-       /*
-       ** Get new format string.  Must be before chdir().
-       */
-       fmtstr = new_fs(form, FORMAT);
+       /* Set format string.  Must be before chdir(). */
+       fmtstr = new_fs(form, scanformat);
        fmt_compile(fmtstr, &fmt);
 
        fmt_dump(fmt);
index 1523a2c37fa678d3f62530f52cbbe855ddd13c15..36e0ab1a89a3fc1106f6927984f9bc837f05b88b 100644 (file)
--- a/uip/inc.c
+++ b/uip/inc.c
@@ -352,8 +352,8 @@ main(int argc, char **argv)
                         dtimenow(), from);
        }
 
-       /* Get new format string */
-       fmtstr = new_fs(form, FORMAT);
+       /* Set format string */
+       fmtstr = new_fs(form, scanformat);
 
        if (noisy) {
                printf("Incorporating new mail into %s...\n\n", folder);
index 76fe4279998e4557aabc6fdef7aa28ea30f459ea..29d4170df4ac251c32c0957c78f8753cf51d8b12 100644 (file)
@@ -98,6 +98,7 @@ static struct proc procs [] = {
        { "replgroupcomps",    &replgroupcomps },
        { "mhlformat",         &mhlformat },
        { "mhlreply",          &mhlreply },
+       { "scanformat",        &scanformat },
 
        { "#--Default-Sequence-Names--", &empty },
        { "seq-all",           &seq_all },
index dc54bf07f240e9bc7f2a3697ec7de804cc4b658d..671509afa0959d7a654ffceaf5cc1f44244a9e50 100644 (file)
@@ -104,10 +104,8 @@ main(int argc, char **argv)
                        app_msgarg(&msgs, cp);
        }
 
-       /*
-       ** Get new format string.  Must be before chdir().
-       */
-       fmtstr = new_fs(form, FORMAT);
+       /* Set format string.  Must be before chdir(). */
+       fmtstr = new_fs(form, scanformat);
 
        /*
        ** We are scanning a maildrop file