It  is  possible  to  edit procedures and files within Prolog.  To edit the
definition of a procedure, use the command:

                               ed ProcedureName?

The  procedure  will be printed onto a temporary file and the standard text
editor  will automatically be called by Prolog.  When the editor is exited,
Prolog  will  replace  the  old definition of the procedure with the edited
form.   If  the  procedure  had  been  read in from a file, the file is not
changed.

If  your  system has more than one text editor available, it is possible to
specify  which  editor is to be used by assigning the name of the editor in
the variable "EDITOR" in the shell environment.

Files of procedures (also called modules) may be edited using the command:

                                  em FileName!

The  standard  text editor will be invoked and the file may be changed.  On
exit  from  the editor, the file will be reloaded.  Any changed made to the
file will be permanent.

Any file, whether it contains Prolog code or not may be edited by using the
command:

                                  ef FileName!

As  with  em,  the text editor will be invoked automatically.  However, the
file is not read by Prolog on exit from the editor.
