PublicShow sourceedit.pl -- Editor interface

This module implements the generic editor interface. It consists of two extensible parts with little in between. The first part deals with translating the input into source-location, and the second with starting an editor.

Source edit(+Spec)
Edit indicated object.
Source edit
Edit associated or script file. This is the Prolog file opened by double-clicking or the file loaded using
% swipl [-s] file.pl
Source locations(+Spec, -Locations) is det
Locate entities matching Spec. Locations is a list of pairs Location-FullSpec, where Location is a dict holding a file, optional line and optional linepos keys. FullSpec is the disambiguated specification, e.g., member expands to member/2 for the predicate.
Source locate(+Spec, -FullSpec, -Location:dict)[multifile]
Source locate(+Spec, -Location)[multifile]
Locate object from the specified location.
Source predicate_location(:Predicate, -Location) is nondet
Find the source location of a predicate.
Arguments:
Predicate- is a qualified head. The module may be unbound at entry. It will be bound to the actual implementation module.
Source addr2location(+Address, -File, -Line) is semidet
Get the File and Line for a C address.
Source edit_command(+Editor, -Command)[multifile]
This predicate should specify the shell-command called to invoke the user's editor. The following substitutions will be made:
%ePath name of the editor
%fPath name of the file to be edited
%dLine number of the target
Source select_location(+Pairs, +UserSpec, -Location) is semidet[multifile]
Arguments:
Pairs- is a list of Location-Spec pairs
Location- is a list of properties