edit.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.
- edit(+Spec)
- Edit indicated object.
- edit
- Edit associated or script file. This is the Prolog file opened
by double-clicking or the file loaded using
% swipl [-s] file.pl
- locate(+Spec, -FullSpec, -Location)[multifile]
- locate(+Spec, -Location)[multifile]
- Locate object from the specified location.
- do_edit_source(+Location)[private]
- Actually call the editor to edit Location, a list of Name(Value)
that contains
file(File)
and may containline(Line)
. First the multifile hook edit_source/1 is called. If this fails the system checks for XPCE and the prolog-flag editor. If the latter is built_in or pce_emacs, it will start PceEmacs.Finally, it will get the editor to use from the prolog-flag editor and use edit_command/2 to determine how this editor should be called.
- editor(-Editor)[private]
- Determine the external editor to run.
- 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:
%e Path name of the editor %f Path name of the file to be edited %d Line number of the target - select_location(+Pairs, +UserSpec, -Location)[multifile]