A prolog process can be started by choosing
Run Prolog from the
Prolog menu, by typing C-c <RET>, or by typing M-x
run-prolog. It is however not strictly necessary to start a prolog
process manually since it is automatically done when consulting or
compiling, if needed. The process can be restarted (i.e. the old
one is killed and a new one is created) by typing C-u C-c
Programs are run and debugged in the normal way, with terminal I/O
*prolog* buffer. The most common debugging
predicates are available from the menu or via key-bindings.
A particularly useful feature under the Emacs interface is source-linked
debugging. This is enabled or disabled using the
level debugging menu entry. It can also be enabled by setting the Emacs
~/.emacs. Both these methods set the Prolog flag
emacs. Its value should be
while loading the code to be debugged and while debugging. If so,
the debugger will display the source code location of the current
goal when it prompts for a debugger command, by overlaying the
beginning of the current line of code with an arrow. If
off when the code was loaded, or if
it was asserted or loaded from
user, the current goal
will still be shown but out of context.
Note that if the code has been modified since it was last loaded,
Prolog's line number information may be invalid. If this happens, just
reload the relevant buffer.
Consultation and compilation is either done via the menu or with the following key-bindings:
The boundaries used when consulting and compiling predicates are the first and last clauses of the predicate the cursor is currently in.
Other useful key-bindings are:
comment-column. This comment will always stay at this position when the line is indented, regardless of changes in the text earlier on the line, provided that
prolog-align-comments-flagis set to
Prolog/Transform/All variables to '_'menu entry. See also the