| Did you know ... | Search Documentation: |
| Predicate print_message_lines/3 |
print_message_lines(+Stream,
+Prefix, +Lines)at_same_line to complete the line.~N).nl, for example because it is ended using ~N
in a Format element. Resetting matters because a terminal
that scrolls while a background colour is in effect paints the newly
exposed line with it, which would colour the empty line that follows the
message. Without a background colour this element produces no output.library(ansi_term) implements this hook to
achieve coloured output. If it is not intercepted it invokes format(Stream,
Format, Args).File:Line:Column, File:Line or File.
When using library library(ansi_term), this is translated
into a hyperlink for modern terminals.url(Location) above. When using
library library(ansi_term), this is translated into a
hyperlink for modern terminals. Label is one of
-Args,
which is handed to format/3.ansi(Class, Format, Args), which prints the
label using the attributes of Class as well as making it a
hyperlink. This is how a predicate reference in a message is both
coloured using the
code class and linked to its definition.begin(Class, Context) and
ended by end(Context). This feature is used by, e.g.,
library library(ansi_term) to colour entire messages.
Class is normally the message kind. The interactive
top level uses answer(Parity) for the messages of kind query
that show bindings, which
stripes the answers of a non-deterministic query. See
section 2.5.format(Stream, Format,[]). Deprecated because it is
ambiguous if Format collides with one of the atomic commands.
Context above is a variable that is bound by the handler
for
begin(Class, Context) and is passed to the elements that
follow it. It allows this handler to restore the decoration of the
message as a whole after an element that installs a decoration of its
own, and to paint the remainder of a line. Its value is opaque: only the
code that implements prolog:message_line_element/2
for begin(Class, Context) may interpret it. If this hook is
not defined, or the output is not a terminal, Context is left
unbound.
To make Context available to the elements that need it,
print_message_lines/3
rewrites the elements nl, flush,
eol and ansi(Attributes, Format, Args) of Lines
into nl(Context), flush(Context), eol(Context)
and
ansi(Attributes, Format, Args, Context) before passing them
to
prolog:message_line_element/2.
A message that is created using prolog:message//1 always uses the short
forms.
See also print_message/2 and message_hook/3.