!TITLE Using files, and calling EMAS commands from within Prolog
!KEY
More usefully the following directives allow the editing  of  EMAS  files,  and
other operations, to be performed from inside Prolog:

            | ?- edit File.

You  are  placed  inside  ECCE,  editing the file File, and when ECCE is exited
(using "%c") you are returned to Prolog.

            | ?- redo File.

This  is  like  edit  except  that  after  returning  from  ECCE  the  file  is
reconsulted, which means that definitions of procedures in the file replace any
existing  definitions.  This  predicate  allows  you  to  correct parts of your
program incrementally.

            | ?- edit.

            | ?- redo.

Without arguments, these predicates perform their operations on the  last  file
you edited with an edit File or redo File.

The following predicates allow you to find out what files you have, and to type
them out onto the terminal:

            | ?- files.

This shows you the names of all your files using the Emas FILES command.

            | ?- dir.

This  is currently a version of FILES, but it is eventually intended to provide
more information about each file.

            | ?- ty File.

The file File is typed out onto the terminal.  This is  probably  quicker  than
editing it with ECCE if you just want a brief look at its contents.

In  general,  it  is  possible  to  call  any  Emas command using the following
evaluable predicates:

            emas(Command)
            emas(Command,Arguments)

Both Command and Arguments must be Prolog atoms, examples of how to  use  these
would be:

            emas(users)
            emas(list,'foo,.lp15')

Note that Arguments is the whole argument string for the command and that if it
contains  characters like "," then it will have to be quoted as in the example,
otherwise  it  would  not  be  syntactically recognised as a Prolog atom. Since
multiple arguments to Emas commands must be separated by commas, you will  have
to quote this atom in most cases.
All  Prolog  predicates  described  earlier in this section, such as edit, redo
etc., are  evaluable  predicates  written  in  Prolog  which  use  emas(_)  and
emas(_,_).    It is very easy for you to write similar conveniences for youself
using these facilities.

