[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Introduction

 Welcome to Andys Editor. This editor was designed as a language configurable
 folding source code editor. This editor provides these features :-

      Folding. The ability to group lines into a larger 'meta-line'.
      Block operations.
      Yank and put model for line copying etc.
      Deleted item stack to allow multiple undeletes.
      Extended regular expression searching.
      Multiple buffers at any one time.
      Portability across many environments.
      Bracket matching.
      User configurable key binding.
      Shelling out to DOS (and filtering through DOS commands).
      The editor is relatively small for what it does.

 This editor is a 'folding editor'. This is a highly useful feature. Once
 you have got used to the folding paradigm, you will not want to use a flat
 editor again!

 Folding is an idea borrowed from the language occam by INMOS, although
 there is prior work in this area. A fold is a group of lines that may be
 considered a unit and described by a single line.

 Eg: Consider the flat piece of code :-

      while not eof(f) do
        begin
          read(f, c);
          write(c)
        end

 This could be folded to give :-

      while not eof(f)
        ... echo out another character from the file

 Where the fold contains :-

      begin
        read(f, c);
        write(c)
      end

 The ... line hides away the details of whats going on. Obviously it makes
 more sense to fold larger and more complicated peices of code away. Its a
 bit like inline subroutines. A particularly nice way to fold Pascal programs
 looks like this :-

      program fred(input, output);

        {highly trivial example of folding}

      var
        i: integer;

        ... initialise
        ... main body

      begin
        initialise;
        main_body
      end.

 As you can see, this style of folding allows you to rapidly find any given
 procedure and enables you to see the structure of the program as a whole.
 Also, you no longer need to page up miles to find the variables!

 Folds can be open or closed. The ones shown already were closed, but if they
 are opened they look like this :-

 while not eof(f)
      {{{ echo out another character from the file
      begin
        read(f, c);
        write(c)
      end
      }}}

 This allows the user to see whats in them without actually entering them.

 There is a second kind of fold, called a virtual fold which allows links to
 other files to be made. For example you might see :-

      program fred(input, output)

      {$I 'header.inc'}
      ::: header.inc

      begin
        etc.

 If you use fold_in on the virtual fold line, then the file is read and
 selected.

 If you later use fold_out from within the top fold of header.inc file,
 then the file is optionally written if modified, discarded, then the
 original buffer is selected. In this way many files may edited as if they
 were only one file.

 Virtual folds may also be opened, in which case they look like this :-

      >>> header.inc

 You cannot see the contents of an open virtual fold, since they are in
 another file, and are not loaded until the virtual fold is entered.

 The significance of opening virtual folds becomes apparent in searching,
 where it is possible to search just open virtual folds, and to skip closed
 ones, during a global search.

 Summary of benefits of folding

 Folding accelerates navigation around a file. The time to find a given
 places is order(log(average_fold_size)), as opposed to order(file_size).

 Folding allows you to hide details of sub-module implementation, thus
 aiding abstraction.

 Folding allows you to hierachically structure programs, even those
 written in 'flat' languages such as Assembler and Prolog. In particular,
 function locality can be emphasized by putting functions used only by a
 given routine, as a sub-fold of that routine.

 The rule of thumb that says that 'each function should fit on a page' can
 be rewritten as 'each function should fit on a page when folded'. This
 allows you to write huge functions, without bringing the complexity of the
 function (as viewed at each level) any higher than before. Each fold is
 effectively an inline function.

 Folding can be used as a focusing tool. For example, if you are in a fold
 holding the implementation of a stack object (to modify or enhance it say),
 you know you need to focus you attention on this fold (and subfolds perhaps),
 but NOT elsewhere.

 How to run the editor

 To run the editor the usage is :-

      ae [-l] [-r] [-w width] [-h height] [-i inifile] {filename}

      -l            means load the files automatically.
      -r            means restricted mode (no shelling allowed).
      -w width      specify non default screen width.
      -h height     specify non default screen height.
      -i inifile    specify non default initialisation file.
      filename      filename of file(s) you wish to load.

 eg: To edit the AE help file AE.TXT :-

      ae ae.txt

 When the editor starts up it performs the following steps :-

      1) Trys to initialise the screen and machine generally.
         If this fails then 'cannot initialise' error occurs.

      2) Creates an empty buffer with no name. This is called the root
         buffer. For each filename given on the command line, it creates a
         virtual fold >>> filename.

      3) If the editor can find the configuration file AE.INI, by
         looking in the directory where AE itself was loaded from, it
         executes the code within it. If there is an error during this
         process, an 'error at line N' message is displayed.

      4) If the -l option is given, it trys to create and load a buffer
         for each file.

      5) If there is only one buffer (other than the root buffer), it is
         selected.

      6) The editor responds to key-strokes and commands from the user.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson