Message Text Control
There is another set of format specifiers that control how text is handled within warning messages. These should appear at the beginning of the format string.
%i(str) |
Indent wrapped text: when text is wrapped, it is indented with |
%q |
Save the location for the next message (used for |
%Q |
Reset the location for the next message.
|
%R(n,c) |
Print "n" times the character specified by "c". |
%s(n) |
Limit message size: text is truncated to n characters. |
%w(n) |
Character wrap: message text wraps at column n. |
%W(n) |
Word wrap: message text wraps after the last word before column n. |
To limit the size of message output to 80 characters per line without word breaks, include the specifier %W(80) in the format string.
The %q
and %Q
entries can be used to override the default behavior of %ˆ
, or to implement similar functionality from scratch. As an example of %R(num,char)
usage:
This will cause the following display of caret lines: