[not loaded]
messages.pl
translate_message(+Term)// is det- Translate a message Term into message lines. The produced lines
is a list of
- nl
- Emit a newline
- Fmt - Args
- Emit the result of
format(Fmt, Args) - Fmt
- Emit the result of
format(Fmt) - ansi(Class, Fmt, Args)
- Use ansi_format/3 for color output.
- url(Location)
- Emit a source location as a hyperlink. Location is File:Line:Column, File:Line, File or a URL.
- url(Location, Label)
- As above, but print Label rather than Location. Label is
plain text, Fmt-Args or
ansi(Class, Fmt, Args), the latter combining a hyperlink with a style class. - flush
- Used only as last element of the list. Simply flush the output instead of producing a final newline.
- at_same_line
- Start the messages at the same line (instead of using ~N)
- eol
- End the decorated part of the last line. See print_message_lines/3.
The elements
begin(Class, Ctx)andend(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- Translate a message term into message lines. This version may be called from user and library definitions for message translation.
term_message(+Term)//- Deal with the formal argument of
error(Format, ImplDefined)exception terms. The ImplDefined argument is handled by swi_location//2.
swi_location(+Term)// is det- Print location information for
error(Formal, ImplDefined)from the ImplDefined term.
predicate_indicator(+Spec, -QPI) is semidet- QPI is the fully qualified predicate indicator
Module:Name/Arityor, for a non-terminal,Module:Name//Arityfor Spec. Spec is one of- A callable term (a head), optionally module qualified
- A predicate indicator, optionally module qualified
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 det- Emit a reference to a predicate. Spec is a (possibly qualified)
head or predicate indicator. The reference is printed using the
style class
codeand, 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:- module(+Which)
- One of
auto(default),hideorshow. Usingauto, the module qualification is removed if hidden_module/1 holds for it. - link(+Bool)
- If
false, do not try to create a hyperlink. Defaulttrue. - style(+Class)
- Style class for the reference. Default
code. - tag(+Bool)
- If
true, add a tag that indicates the kind of predicate. See predicate_kind/2. Defaultfalse. 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
codeclass and~p, i.e., we never fail on a malformed message.
predicate_location(+Spec, -Location) is semidet- Location is
File:Linefor 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- Emit "Message at File:Line" on a new line if the location of Spec is known and nothing at all if it is not.
predicate_kind(+Spec, -Kind) is semidet- Classify a predicate for the benefit of the user who has to pick one
from a list of candidates. Fails if Spec is not a predicate. Kind
is one of
- iso
- built_in
- foreign
library(Name)module(Module)- user
- undefined
current_theme(-Theme) is det- Theme is the theme that defines the console colours (see
prolog:console_color/3). This is the value of the Prolog flag
theme, unless this isdefaultorauto. In that case it is the theme of a loaded theme file, e.g., a file loaded from the init file or by library(theme/auto). If no theme file is loaded, Theme isdefault.
theme_ancestor(+Theme, -Ancestor) is nondet- Ancestor is Theme or a theme Theme is based on, nearest first. A theme is based on another theme using the multifile hook prolog:theme_base/2. A theme uses the settings of its base theme that it does not define itself.
print_message(+Kind, +Term)- Print an error message using a term as generated by the exception system.
print_message_lines(+Stream, +PrefixOrKind, +Lines)- Quintus compatibility predicate to print message lines using
a prefix.
If PrefixOrKind is
kind(Kind), the message as a whole may be decorated. To this end the lines are wrapped inbegin(Class, Ctx)andend(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- Decompose the label of an url/2 message element. See url/2 in
print_message_lines/3. Note that a plain label is text rather than
a format: it typically holds a file name, which may contain
~.
message_to_string(+Term, -String)- Translate an error term into a string