SWI-Prolog offers an interface to the Unix vi editor and the
GNU Emacs invocations emacs and emacsclient. Which
editor is used is determined by the Unix environment variable
EDITOR
, which should hold the full pathname of the editor.
If this variable is not defined, vi is used. (12)
After the user quits the editor, make/0 is invoked to reload all modified source files using consult/1. If the editor can be quit such that an exit status non-equal to 0 is returned make/0 will not be invoked. top can do this by typing control-C, vi cannot do this.
A predicate specification is either a term with the same functor and arity as the predicate wanted, a term of the form Functor/Arity or a single atom. In the latter case the database is searched for a predicate of this name and arbitrary arity (see current_predicate/2). When more than one such predicate exists the system will prompt for confirmation on each of the matched predicates. Predicates specifications are given to the `Do What I Mean' system (see dwim_predicate/2) if the requested predicate does not exist.
<Head> :- <Body>
'
(put brackets around it to avoid operator precedence problems). Facts
are represented as `<Head> :- true
'.
user
to specify
how the predicates ed/1
and edit/1
call the editor. If ed/1
is invoking this hook, Spec is a term of the format
File:LineNo:Name/Arity
Where File and LineNo represents the location
of the predicate remembered by Prolog, and Name and Arity
specify the predicate. If invoked by edit/1, Spec
is an atom denoting the name of the file to be edited. This hook is
defined by the library
library(swi_prolog)
distributed with the XPCE package for
using XPCE to edit Prolog files.