Next: Profile Variable Diffs, Up: Diffs
Decodes the input string str as per RFC 2047. Useful in printing ‘From:’, ‘To:’ and ‘Subject:’ headers.
Notice that, unlike the similar NMH function,
decode
checks the value of the global profile variableCharset
(see Charset variable) to determine the charset to output the result in. If this variable is not set,decode
returns its argument without any change. If this variable is set toauto
,decode
tries to determine the charset name from the setting of LC_ALL environment variable. Otherwise, the value ofCharset
is taken to be the name of the character set.
The function removes any leading whitespace and eventual ‘Re:’ prefix from its argument. Useful for creating subjects in reply messages:
%<{subject}Subject: Re: %(unre{subject})\\n%>
Sets the regular expression used to recognize reply messages. The argument r should be a POSIX extended regular expression. Matching is case insensitive.
For example, the following invocation
%(reply_regex ^\(re|aw|ang|odp\)\(\\[[0-9]+\\]\)?:[[:blank:]])corresponds to English ‘Re’, Polish ‘Odp’, Norwegian ‘Aw’ or German ‘Ang’, optionally followed by a number in brackets, followed by colon and any amount of whitespace. Notice proper quoting of the regex metacharacters.
See also
Reply-Regex
(see Reply-Regex variable) andisreply
(see isreply MH function) below.
If str is not given, the value of ‘Subject:’ header is taken.
The function returns true if its argument matches the “reply subject” regular expression. This expression is set via the global profile variable
Reply-Regex
(see Reply-Regex variable) or via the format functionreply_regex
.This function is useful for creating ‘Subject:’ headers in reply messages. For example, consider the following construction:
%<{subject}%(lit)%<(isreply)%?\ (profile reply-prefix)%(concat)%|%(concat Re:)%>\ %(concat{subject})%(printhdr Subject: )\n%>If the ‘Subject:’ header already contained reply prefix, this construct leaves it unchanged. Otherwise it prepends to it the value of
Reply-Prefix
profile variable, or, if it is unset, the string ‘Re:’.This expression is used in default replcomps and replgroupcomps files.
This function returns true if the given element is present in the recipient mask (as modified by --cc or --nocc options) and false otherwise. It is used in default formats for repl and comp, e.g.:
%(lit)%<(rcpt to)%(formataddr{to})%>Notice that this means that usual replcomps file will be ignoring --cc and --nocc options, unless it has been modified as shown above.
Prints the value of string register, prefixed by str. The output is formatted as a RFC 822 header, i.e. it is split at whitespace characters nearest to the width boundary and each subsequent segment is prefixed with horizontal tabulation.