From: markus schnalke Date: Wed, 20 Apr 2016 06:19:24 +0000 (+0200) Subject: Make default scan/inc listing file-based X-Git-Tag: mmh-0.3~45 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=e2550f03c9679b6fcc5240f9cda48bd5a9951e3a;p=mmh Make default scan/inc listing file-based 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'. --- diff --git a/config/config.c b/config/config.c index 2bf7325..5e25041 100644 --- a/config/config.c +++ b/config/config.c @@ -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 */ /* diff --git a/etc/Makefile.in b/etc/Makefile.in index da3bb51..fd00e0d 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -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 index 0000000..902998a --- /dev/null +++ b/etc/scan.default @@ -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 33b38ee..a5a12ce 100644 --- 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; diff --git a/h/scansbr.h b/h/scansbr.h index 91b2ff6..5e5816d 100644 --- a/h/scansbr.h +++ b/h/scansbr.h @@ -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) diff --git a/uip/fmtdump.c b/uip/fmtdump.c index 5266235..a91333b 100644 --- a/uip/fmtdump.c +++ b/uip/fmtdump.c @@ -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); diff --git a/uip/inc.c b/uip/inc.c index 1523a2c..36e0ab1 100644 --- 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); diff --git a/uip/mhparam.c b/uip/mhparam.c index 76fe427..29d4170 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -98,6 +98,7 @@ static struct proc procs [] = { { "replgroupcomps", &replgroupcomps }, { "mhlformat", &mhlformat }, { "mhlreply", &mhlreply }, + { "scanformat", &scanformat }, { "#--Default-Sequence-Names--", &empty }, { "seq-all", &seq_all }, diff --git a/uip/scan.c b/uip/scan.c index dc54bf0..671509a 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -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