From: David Levine Date: Tue, 14 Jul 2015 02:32:36 +0000 (-0400) Subject: Unquoted addresses in mhshow and scan output. Suggested by X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/8a1edeb17377d465644430b29cb04a4fe06d4a3b?ds=inline;hp=d55766c55a199d83b4a23f235710f41e87a1fcb7 Unquoted addresses in mhshow and scan output. Suggested by Anthony Bentley. --- diff --git a/etc/mhl.format b/etc/mhl.format index 7f8a5672..289f0b8f 100644 --- a/etc/mhl.format +++ b/etc/mhl.format @@ -9,7 +9,7 @@ ignores=msgid,message-id,received,content-type,content-transfer-encoding,content Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>" To: cc: -From:decode +From:formatfield="%(unquote(decode{text}))" Subject:decode : extras:nocomponent diff --git a/etc/mhl.headers b/etc/mhl.headers index 8fee181c..27a08d71 100644 --- a/etc/mhl.headers +++ b/etc/mhl.headers @@ -10,7 +10,7 @@ ignores=msgid,message-id,received,content-type,content-transfer-encoding,content Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>" To: cc: -From:decode +From:formatfield="%(unquote(decode{text}))" Subject:decode : extras:nocomponent diff --git a/etc/mhl.reply b/etc/mhl.reply index 3498263b..dffc0d2f 100644 --- a/etc/mhl.reply +++ b/etc/mhl.reply @@ -2,5 +2,5 @@ ; ; default message filter for `repl' (repl -format) ; -from:nocomponent,formatfield="%(decode(friendly{text})) writes:" +from:nocomponent,formatfield="%(unquote(decode(friendly{text}))) writes:" body:component="> ",overflowtext="> ",overflowoffset=0 diff --git a/etc/mhl.replywithoutbody b/etc/mhl.replywithoutbody index 6abeab38..41421eaa 100644 --- a/etc/mhl.replywithoutbody +++ b/etc/mhl.replywithoutbody @@ -2,4 +2,4 @@ ; ; message filter for `repl' (repl -format) that excludes the message body ; -from:nocomponent,formatfield="%(decode(friendly{text})) writes:" +from:nocomponent,formatfield="%(unquote(decode(friendly{text}))) writes:" diff --git a/etc/scan.MMDDYY b/etc/scan.MMDDYY index dd20b290..f4a20bd5 100644 --- a/etc/scan.MMDDYY +++ b/etc/scan.MMDDYY @@ -5,6 +5,6 @@ %; %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})/%(void(year{date}))%02(modulo 100)%<{date} %|*%>\ -%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ -%<(zero)%17(decode(friendly{from}))%> \ +%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ +%<(zero)%17(unquote(decode(friendly{from})))%> \ %(decode{subject})%<{body}<<%{body}>>%> diff --git a/etc/scan.YYYYMMDD b/etc/scan.YYYYMMDD index 741681de..97016c2c 100644 --- a/etc/scan.YYYYMMDD +++ b/etc/scan.YYYYMMDD @@ -5,6 +5,6 @@ %; %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %4(year{date})-%02(mon{date})-%02(mday{date})%<{date} %|*%>\ -%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ -%<(zero)%17(decode(friendly{from}))%> \ +%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ +%<(zero)%17(unquote(decode(friendly{from})))%> \ %(decode{subject})%<{body}<<%{body}>>%> diff --git a/etc/scan.curses b/etc/scan.curses index 913f2c01..53f6bb69 100644 --- a/etc/scan.curses +++ b/etc/scan.curses @@ -37,8 +37,8 @@ %; %; If the message is from me, print out who the message was sent to. %; Otherwise, print out who it was from. -%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ -%<(zero)%17(decode(friendly{from}))%> \ +%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ +%<(zero)%17(unquote(decode(friendly{from})))%> \ %; %; Print out the subject and any of th mesage body that will fit on the %; rest of the line. After that, print the terminal reset code to reset diff --git a/etc/scan.default b/etc/scan.default index f898e86c..adca1fcb 100644 --- a/etc/scan.default +++ b/etc/scan.default @@ -6,6 +6,6 @@ %; %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ -%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ -%<(zero)%17(decode(friendly{from}))%> \ +%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ +%<(zero)%17(unquote(decode(friendly{from})))%> \ %(decode{subject})%<{body}<<%{body}>>%> diff --git a/etc/scan.highlighted b/etc/scan.highlighted index 4bffe588..0e46f156 100644 --- a/etc/scan.highlighted +++ b/etc/scan.highlighted @@ -36,6 +36,6 @@ %<(unseen)%(zputlit(lit ))%>\ %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ -%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ -%<(zero)%17(decode(friendly{from}))%> \ +%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ +%<(zero)%17(unquote(decode(friendly{from})))%> \ %(decode{subject})%<{body}<<%{body}>>%>%(zputlit(lit )) diff --git a/etc/scan.mailx b/etc/scan.mailx index 27d18d32..942e2653 100644 --- a/etc/scan.mailx +++ b/etc/scan.mailx @@ -2,8 +2,8 @@ %<{status} %|N%>\ %<{replied}R%?{encrypted}E%| %>\ %4(msg) \ -%<(mymbox{from})%<{to}To: %13(decode(friendly{to}))%>%>\ -%<(zero)%17(decode(friendly{from}))%> \ +%<(mymbox{from})%<{to}To: %13(unquote(decode(friendly{to})))%>%>\ +%<(zero)%17(unquote(decode(friendly{from})))%> \ %3(day{date}) %3(month{date}) %02(mday{date}) \ %02(hour{date}):%02(min{date}) \ %(decode{subject}) diff --git a/etc/scan.size b/etc/scan.size index a6b6698c..9b48078c 100644 --- a/etc/scan.size +++ b/etc/scan.size @@ -1,6 +1,6 @@ %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %5(size) \ -%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ -%<(zero)%17(decode(friendly{from}))%> \ +%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ +%<(zero)%17(unquote(decode(friendly{from})))%> \ %(decode{subject})%<{body}<<%{body}%> diff --git a/etc/scan.time b/etc/scan.time index ee54a523..ff376285 100644 --- a/etc/scan.time +++ b/etc/scan.time @@ -2,6 +2,6 @@ %02(mon{date})/%02(mday{date}) \ %02(hour{date}):%02(min{date})%3(tzone{date})\ %<{date} %|*%>\ -%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ -%<(zero)%17(decode(friendly{from}))%> \ +%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ +%<(zero)%17(unquote(decode(friendly{from})))%> \ %(decode{subject})%<{body}<<%{body}%> diff --git a/etc/scan.timely b/etc/scan.timely index 06c068c2..de09b8b7 100644 --- a/etc/scan.timely +++ b/etc/scan.timely @@ -5,6 +5,6 @@ %?(gt 86400) %(day{date}) %|\ %02(hour{date}):%02(min{date})%>\ %<{date} %|*%>\ -%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ -%<(zero)%17(decode(friendly{from}))%> \ +%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ +%<(zero)%17(unquote(decode(friendly{from})))%> \ %(decode{subject})%<{body}<<%{body}%> diff --git a/etc/scan.unseen b/etc/scan.unseen index d1cd195c..1b254d4d 100644 --- a/etc/scan.unseen +++ b/etc/scan.unseen @@ -1,5 +1,5 @@ %4(msg)%<(cur)+%| %>%<(unseen)U%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ -%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ -%<(zero)%17(decode(friendly{from}))%> \ +%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\ +%<(zero)%17(unquote(decode(friendly{from})))%> \ %(decode{subject})%<{body}<<%{body}>>%> diff --git a/test/format/test-fmtdump b/test/format/test-fmtdump index 5680a5b1..73fd14de 100755 --- a/test/format/test-fmtdump +++ b/test/format/test-fmtdump @@ -107,9 +107,68 @@ L10: CHAR '\n' EOF run_prog $fmtdump >$actual 2>&1 -check $expected $actual 'keep first' +check $expected $actual # check -form +cat >$expected < + LV_MON, c_name "date", c_type + NUMF, width 2, fill '0' + CHAR '/' + PARSEDATE, c_name "date", c_type + LV_MDAY, c_name "date", c_type + NUMF, width 2, fill '0' + LS_COMP, comp "date", c_type + IF_S continue else goto L6 + CHAR ' ' + GOTO L7 +L6: CHAR '*' +L7: MYMBOX, c_name "from", c_type + LV_COMPFLAG, comp "from", c_type + IF_V_NE 0 continue else goto L8 + LS_COMP, comp "to", c_type + IF_S continue else goto L8 + LIT "To:" + PARSEADDR, c_name "to", c_type + LS_FRIENDLY, c_name "to", c_type + FT_LS_DECODE + + STRF, width 14, fill ' ' +L8: IF_V_EQ 0 continue else goto L9 + PARSEADDR, c_name "from", c_type + LS_FRIENDLY, c_name "from", c_type + FT_LS_DECODE + + STRF, width 17, fill ' ' +L9: LIT " " + LS_COMP, comp "subject" + FT_LS_DECODE + STR + LS_COMP, comp "body" + IF_S continue else goto L10 + LIT "<<" + COMP, comp "body" + LIT ">>" +L10: CHAR '\n' + DONE +EOF + run_prog $fmtdump -form "$MH_INST_DIR${nmhetcdir}/scan.default" >$actual 2>&1 check $expected $actual