]> diplodocus.org Git - nmh/commitdiff
Unquoted addresses in mhshow and scan output. Suggested by
authorDavid Levine <levinedl@acm.org>
Tue, 14 Jul 2015 02:32:36 +0000 (22:32 -0400)
committerDavid Levine <levinedl@acm.org>
Tue, 14 Jul 2015 02:32:36 +0000 (22:32 -0400)
Anthony Bentley.

15 files changed:
etc/mhl.format
etc/mhl.headers
etc/mhl.reply
etc/mhl.replywithoutbody
etc/scan.MMDDYY
etc/scan.YYYYMMDD
etc/scan.curses
etc/scan.default
etc/scan.highlighted
etc/scan.mailx
etc/scan.size
etc/scan.time
etc/scan.timely
etc/scan.unseen
test/format/test-fmtdump

index 7f8a567..289f0b8 100644 (file)
@@ -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
index 8fee181..27a08d7 100644 (file)
@@ -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
index 3498263..dffc0d2 100644 (file)
@@ -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
index 6abeab3..41421ea 100644 (file)
@@ -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:"
index dd20b29..f4a20bd 100644 (file)
@@ -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}>>%>
index 741681d..97016c2 100644 (file)
@@ -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}>>%>
index 913f2c0..53f6bb6 100644 (file)
@@ -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
index f898e86..adca1fc 100644 (file)
@@ -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}>>%>
index 4bffe58..0e46f15 100644 (file)
@@ -36,6 +36,6 @@
 %<(unseen)%(zputlit(lit \e[36;40m))%>\
 %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 \e[m))
index 27d18d3..942e265 100644 (file)
@@ -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})
index a6b6698..9b48078 100644 (file)
@@ -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}%>
index ee54a52..ff37628 100644 (file)
@@ -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}%>
index 06c068c..de09b8b 100644 (file)
@@ -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}%>
index d1cd195..1b254d4 100644 (file)
@@ -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}>>%>
index 5680a5b..73fd14d 100755 (executable)
@@ -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 <<EOF
+       LV_DAT, value dat[0]
+       NUMF, width 4, fill ' '
+       LV_DAT, value dat[1]
+       IF_V_NE 0 continue else goto L0
+       CHAR '+'
+       GOTO L1
+L0:    CHAR ' '
+L1:    LS_COMP, comp "replied"
+       IF_S continue else goto L2
+       CHAR '-'
+       GOTO L3
+L2:    LS_COMP, comp "encrypted"
+       IF_S continue else goto L4
+       CHAR 'E'
+L3:    GOTO L5
+L4:    CHAR ' '
+L5:    PARSEDATE, c_name "date", c_type <DATE>
+       LV_MON, c_name "date", c_type <DATE>
+       NUMF, width 2, fill '0'
+       CHAR '/'
+       PARSEDATE, c_name "date", c_type <DATE>
+       LV_MDAY, c_name "date", c_type <DATE>
+       NUMF, width 2, fill '0'
+       LS_COMP, comp "date", c_type <DATE>
+       IF_S continue else goto L6
+       CHAR ' '
+       GOTO L7
+L6:    CHAR '*'
+L7:    MYMBOX, c_name "from", c_type <ADDR>
+       LV_COMPFLAG, comp "from", c_type <ADDR>
+       IF_V_NE 0 continue else goto L8
+       LS_COMP, comp "to", c_type <ADDR>
+       IF_S continue else goto L8
+       LIT "To:"
+       PARSEADDR, c_name "to", c_type <ADDR>
+       LS_FRIENDLY, c_name "to", c_type <ADDR>
+       FT_LS_DECODE
+       
+       STRF, width 14, fill ' '
+L8:    IF_V_EQ 0 continue else goto L9
+       PARSEADDR, c_name "from", c_type <ADDR>
+       LS_FRIENDLY, c_name "from", c_type <ADDR>
+       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