| Did you know ... | Search Documentation: |
| messages.pl |
translate_message(+Term)// is detformat(Fmt, Args)format(Fmt)ansi(Class, Fmt, Args), the latter
combining a hyperlink with a style class.
The elements begin(Class, Ctx) and end(Ctx) that decorate the
message as a whole are added by print_message_lines/3.
Use predicate_reference//1,2 to refer to a predicate rather than formatting the predicate indicator by hand.
translate_message(+Term)// is det
term_message(+Term)//error(Format, ImplDefined)
exception terms. The ImplDefined argument is handled by
swi_location//2.
swi_location(+Term)// is deterror(Formal, ImplDefined) from the
ImplDefined term.
predicate_indicator(+Spec, -QPI) is semidetModule:Name/Arity
or, for a non-terminal, Module:Name//Arity for Spec. Spec is one
of
The module is kept here. Whether or not it is printed is left to predicate_reference//2, which uses user_predicate_indicator/2.
predicate_reference(+Spec)// is det
predicate_reference(+Spec, +Options)// is detcode and, if the location of the predicate is known and
the output is a terminal that supports it, it is a hyperlink to the
definition. Options:
auto (default), hide or show. Using auto, the
module qualification is removed if hidden_module/1 holds for it.false, do not try to create a hyperlink. Default true.code.true, add a tag that indicates the kind of predicate.
See predicate_kind/2. Default false. Only sensible if the
reference is the only thing on the line.
If Spec cannot be interpreted as a predicate it is printed using the
code class and ~p, i.e., we never fail on a malformed message.
predicate_location(+Spec, -Location) is semidetFile:Line for the definition of the predicate Spec.
Also deals with predicates defined in C. Note that predicates that
are not loaded but can be autoloaded are located from the autoload
index, i.e., printing a message never loads a library.
predicate_definition(+Spec, +Message)// is det
predicate_kind(+Spec, -Kind) is semidetlibrary(Name)module(Module)
print_message(+Kind, +Term)
print_message_lines(+Stream, +PrefixOrKind, +Lines)
If PrefixOrKind is kind(Kind), the message as a whole may be
decorated. To this end the lines are wrapped in begin(Class, Ctx)
and end(Ctx), where Class is derived from Kind using
msg_color_class/2. Ctx is a variable that is bound by whoever
implements prolog:message_line_element/2 for begin/2 (normally
library(ansi_term)) and remains unbound if the decoration is not
available, e.g., because Stream is not a terminal.
The elements that need Ctx are rewritten by prefix_nl/4 to carry it. See there for the details.
link_label(+Label, -Format, -Args) is det~.
message_to_string(+Term, -String)