]> diplodocus.org Git - nmh/blob - etc/scan.curses
getpass.c: Move interface to own file.
[nmh] / etc / scan.curses
1 %; scan.curses
2 %;
3 %; This file shows how to use function escapes to enable highlighting
4 %; sequences for terminals that have the appropriate entries in their
5 %; termcap/terminfo files. Also it goes into more detail on exactly
6 %; what each line does.
7 %;
8 %; See mh-format(5) for more information on these function escapes.
9 %;
10 %;
11 %; First, test to see if this is the current message. If it is, then
12 %; output the standout sequence for this terminal (or the color red).
13 %; We use %(zputlit) so the
14 %; characters we output don't count against the terminal width.
15 %;
16 %<(cur)%<(hascolor)%(zputlit(fgcolor red))%|%(zputlit(standout))%>%>\
17 %;
18 %; If it's unseen, mark it with bold (or the color green)
19 %;
20 %<(unseen)%<(hascolor)%(zputlit(fgcolor green))%|%(zputlit(bold))%>%>\
21 %;
22 %; Next, output the message number. We print it out using 4 digits, right-
23 %; justified, padding with spaces.
24 %;
25 %4(msg)\
26 %;
27 %; If it's the current message, output a '+' in the next column, otherwise
28 %; a space. Also use '-' if it's got a "Replied" header and 'E' if it's
29 %; encrypted (not currently supported)
30 %;
31 %<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
32 %;
33 %; Output the date, but mark it with a '*' if it's missing and was synthesized.
34 %; Note the use of 02 to make sure the date is padded with a leading zero.
35 %;
36 %02(mon{date})/%02(mday{date})%<{date} %|*%>\
37 %;
38 %; If the message is from me, print out who the message was sent to.
39 %; Otherwise, print out who it was from.
40 %<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\
41 %<(zero)%17(unquote(decode(friendly{from})))%> \
42 %;
43 %; Print out the subject and any of the message body that will fit on the
44 %; rest of the line. After that, print the terminal reset code to reset
45 %; all of the attributes to the next line.
46 %;
47 %; There's actually special handling in the format engine that will output
48 %; any data specified with %(zputlit) even if you've exceeded the column
49 %; width, so it's safe to put any reset characters at the end; they'll
50 %; still be output.
51 %;
52 %(decode{subject})%<{body}<<%{body}>>%>%(zputlit(resetterm))