home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / ae.zip / ae.txt < prev   
Text File  |  1998-10-17  |  37KB  |  986 lines

  1. Andys Editor Help-file
  2.  
  3. Minimum information required to get started using AE, using supplied .INI file.
  4.  
  5.     ~X means Shift-X, ^X means Ctrl-X and @X means Alt-X.
  6.  
  7.     Esc    to cancel current command, or bring up command menu.
  8.     Arrows    Move around buffer (or traditional Wordstar cursor diamond).
  9.     F3    Enters fold (or ^L ^I).
  10.     F4    Exits fold (or ^L ^O).
  11.     @X    Exits editor (or other_exit from command menu).
  12.  
  13. /*...sinstallation:0:*/
  14. The usual supplied ae.zip file should be expanded using "unzip ae" on a UNIX
  15. machine, or "unzip -a ae" on a PC.
  16.  
  17. The supplied package includes the following for PC users :-
  18.  
  19.     ae_dos.exe    runs on DOS, and in DOS boxes
  20.     ae_o16.exe    runs on 16 bit OS/2, 32 bit OS/2, and Windows NT/95
  21.     ae_dual.exe    runs on 16 bit OS/2, 32 bit OS/2, Windows NT/95 and DOS
  22.     ae_os2.exe    runs on 32 bit OS/2
  23.     ae_win.exe    runs on Windows NT/95
  24.     ae.ini        Should work on any of the above
  25.     ae.ico        For OS/2
  26.  
  27. Copy the executable of your choice to a directory on the PATH, calling it
  28. ae.exe. Also place the ae.ini initialisation file there.
  29.  
  30. The following UNIX files are included :-
  31.  
  32.     ae_aix4        RS/6000 executable compiled on AIX 4.1.
  33.     ae_linux    Intel Linux executable.
  34.     ae_hpux        HP/UX PA 2.0 executable
  35.     ae_sun        Solaris executable
  36.  
  37. Put the ae binary on the PATH, put ae.ini in the same place as ae.
  38. If you have your own ~/.aerc, this is used in preference to ae.ini.
  39.  
  40. AE for Linux currently uses ncurses 1.9.9e. This looks for the terminfo
  41. terminal database along a path given by the TERMINFO environment variable (if
  42. set), and then in /usr/lib/terminfo. Later versions of ncurses, such as that
  43. in the RedHat distribution install the database in /usr/share/terminfo, often
  44. without providing a symbolic link from /usr/lib/terminfo for backwards
  45. compatibility. If you are told you 'cannot open the terminal', either add a
  46. symbolic link, or set the TERMINFO environment variable.
  47.  
  48. Under RedHat Linux, if you want colour support, it may be necessary to change
  49. your TERM environment variable from xterm to xterm-color. Slackware doesn't
  50. seem to need this.
  51.  
  52. Basic text help is provided :-
  53.  
  54.     ae.txt        This help document
  55.  
  56. For those of you with WWW browsers, and who'd like better help :-
  57.  
  58.     http://www.interalpha.net/customer/nyangau/
  59.  
  60. Remember, when uploading files to a UNIX machine, ae is a binary file,
  61. and anything else is ASCII.
  62. /*...e*/
  63. /*...sintroduction:0:*/
  64. Welcome to Andys Editor. This editor was designed as a language configurable
  65. folding source code editor. This editor provides these features :-
  66.  
  67.     Folding. The ability to group lines into a larger 'meta-line'.
  68.     Block operations.
  69.     Yank and put model for line copying etc.
  70.     Deleted item stack to allow multiple undeletes.
  71.     Extended regular expression searching.
  72.     Multiple buffers at any one time.
  73.     Portability across many machines.
  74.     Bracket matching.
  75.     User configurable keyboard binding.
  76.     Shelling of nested processes (and filtering of folds through commands).
  77.     The editor is relatively small for what it does.
  78.  
  79. This editor is a folding editor. This is a highly useful feature. Once you have
  80. got used to the folding paradigm, you will not want to use a flat editor again!
  81. /*...e*/
  82. /*...swhat is a folding editor\63\:0:*/
  83. Folding is an idea borrowed from the language occam by INMOS. A fold is a group
  84. of lines that may be considered a unit and described by a single line.
  85.  
  86. Eg: Consider the flat piece of code :-
  87.  
  88.     while not eof(f) do
  89.       begin
  90.         read(f, c);
  91.         write(c)
  92.       end
  93.  
  94. This could be folded to give :-
  95.  
  96.     while not eof(f) do
  97. /*...secho out another character from the file:10:*/
  98. begin
  99.   read(f, c);
  100.   write(c)
  101. end
  102. /*...e*/
  103.  
  104. The ... line hides away the details of whats going on. Obviously it makes more
  105. sense to fold larger and more complicated peices of code away. Its a bit like
  106. inline subroutines. A particularly nice way to fold Pascal programs looks like
  107. this :-
  108.  
  109.     program fred(input, output);
  110.  
  111.       {highly trivial example of folding}
  112.  
  113.     var
  114.       i: integer;
  115.  
  116. /*...sinitialise:10:*/
  117. procedure initialise;
  118.  
  119. /*...ssign_on:12:*/
  120. procedure sign_on;
  121.  
  122. begin
  123.   writeln('FRED version 1.0')
  124. end {sign_on};
  125. /*...e*/
  126.  
  127. begin
  128.   sign_on;
  129.   i := 1
  130. end {initialise};
  131. /*...e*/
  132. /*...smain_body:10:*/
  133. procedure main_body;
  134.  
  135. begin
  136.   writeln('i is ',i:1)
  137. end {main_body};
  138. /*...e*/
  139.  
  140.     begin
  141.       initialise;
  142.       main_body
  143.     end.
  144.  
  145. As you can see, this style of folding allows you to rapidly find any given
  146. procedure and enables you to see the structure of the program as a whole. Also,
  147. you no longer need to page up miles to find the variables!
  148.  
  149. Folds can be open or closed. The ones shown already were closed, but if they
  150. are opened they look like this :-
  151.  
  152.     while not eof(f) do
  153. /*...Secho out another character from the file:10:*/
  154. begin
  155.   read(f, c);
  156.   write(c)
  157. end
  158. /*...e*/
  159.  
  160. This allows the user to see whats in them without actually entering them.
  161.  
  162. There is a second kind of fold, called a virtual fold which allows links to
  163. other files to be made. For example you might see :-
  164.  
  165.     program fred(input, output)
  166.     
  167.     {$I 'header.inc'}
  168. /*...vheader\46\inc:8:*/
  169.  
  170.     begin
  171.       etc.
  172.  
  173. If you use 'fold_in' on the virtual fold line, then the file is read and
  174. selected. I suggest you don't try it on the virtual fold above, since it is
  175. unlikely you have a file header.inc for AE to load!
  176.  
  177. If you later use 'fold_out' from within the top fold of header.inc file, then
  178. the file is optiobally written if modified, discarded, then the original buffer
  179. is selected. In this way many files may edited as if they were only one file.
  180.  
  181. Virtual folds may also be opened, in which case they look like this :-
  182.  
  183. /*...Vheader\46\inc:8:*/
  184.  
  185. You cannot see the contents of an open virtual fold, since they are in another
  186. file, and are not loaded until the virtual fold is entered.
  187.  
  188. The significance of opening virtual folds becomes apparent in searching, where
  189. it is possible to search just open virtual folds, and to skip closed ones,
  190. during a global search.
  191. /*...e*/
  192. /*...swhat is on the screen\63\:0:*/
  193. If you are in the editor now, looking at this fold you should see the following
  194. on the top 3 lines :-
  195.  
  196.     1) The name of this help file (probably c:ae.txt) at the top left.
  197.     2) The current folds tag just below that (whats on the screen?).
  198.     3) A blank line below that (where prompts and error messages appear).
  199.     4) The language name (probably top) for the current buffer.
  200.     5) The current line and column numbers at the top right.
  201.        The line number is the 'flat' line number (ie: over the whole file).
  202.     6) One or more of the words 'autoindent', 'overtype' and 'insert'.
  203.        These specify the current editing mode.
  204.     7) Either ^I or a number specifying either the number of spaces
  205.        per press of the tab key or that real chr$(9) tabs are in force.
  206.  
  207. Below that, you should see this text.
  208.  
  209. You will also see a line with a single ^ on it below this text. This marks the
  210. end of the current fold. Typing on it automatically inserts a new line. Any
  211. unused lines are marked with a ~ in UNIX vi(1) style.
  212. /*...e*/
  213. /*...scommand line and startup:0:*/
  214. When this editor loads it does the following :-
  215.  
  216. Processes the command line arguments :-
  217.  
  218.     ae [-l] [-r] [-w width] [-h height] [-i inifile] {filename}
  219.  
  220.     -l        means load filename arguments into buffers
  221.     -r        restricted version (no shelling allowed)
  222.     -w width    set screen mode to width columns
  223.     -h height    set screen mode to height lines
  224.     -i inifile    executes inifile instead of default name
  225.  
  226. Trys to initialise the screen driver. If -w and -h are not specified a default
  227. screen size is used. Alternatively, the editor trys to initialise a screen of
  228. the desired size. What are allowable screen sizes depend on the hardware
  229. installed etc.
  230.  
  231. Next a buffer is created with no name. A virtual fold line is created for each
  232. filename argument. On closedown the editor will not write this buffer, since it
  233. has no name.
  234.  
  235. Then the configuration file is executed, line by line, stopping if an error
  236. occurs. If an error occurs, the line number is given, and AE will continue
  237. when the user presses a key.
  238.  
  239. If the -l switch is given the editor attempts to create a buffer for each
  240. filename argument and then to load them.
  241.  
  242. If there is only one file, and the -l switch is not given, the file is read
  243. in anyway.
  244.  
  245. If there is only one file, it is selected.
  246.  
  247. Then the editor signs on with its version date.
  248. /*...e*/
  249. /*...seditor commands:0:*/
  250. This fold lists all the commands available in the editor to the user. These
  251. may be executed in 3 ways :-
  252.  
  253.     1) By pressing escape and selecting them from the menu system.
  254.        The main menu gives a list of sub-menus, grouped by function.
  255.        These sub-menus give command names, and prompt the user for
  256.        arguments.
  257.  
  258.     2) By pressing escape, selecting 'COMMAND' and typing them in.
  259.        The 'COMMAND' menu selection is special in that it does not give
  260.        a second level menu, but rather it prompts the user for a
  261.        command string to be executed.
  262.  
  263.     3) By using a key-binding that uses the required commands.
  264.        A key-binding is a connection between a key or a pair of keys and
  265.        a command string.
  266.  
  267. A command string is a list of command names followed by arguments.
  268.  
  269. /*...sarguments:0:*/
  270. Arguments may be supplied with the commands, or interactively.
  271.  
  272. Character arguments may be supplied as unsigned decimal ASCII codes,
  273. or as single quoted characters. They may also be specified in hex by preceeding
  274. the number with a & symbol.
  275.  
  276. String arguments may be supplied quoted in "'s. Real quotes may be supplied
  277. by escaping them with \'s and real \'s may be supplied by quoting themseleves.
  278.  
  279. Numbers may be supplied as unsigned decimal numbers. They may also be specified
  280. in hex by preceeding the number with an & symbol.
  281.  
  282. Yes/No responses may be supplied as 'yes' or 'no'.
  283.  
  284. 'When' responses (when to enter a fold during searching for example) may
  285. be supplied as 'always', 'if_open' or 'never'.
  286.  
  287. Buffer and language arguments may be supplied by stating their names in
  288. double quotes. Alternatively '.' may be supplied to indicate the current
  289. buffer or language of the current buffer.
  290.  
  291. With all the arguments specifying ? will cause the user to be prompted
  292. for the arguments value. This is usually via a menu.
  293.  
  294. Eg:    character_overtype 65        overtype the current character with A
  295.     character_type 'A'        type A
  296.     character_insert ?        insert a character (to be decided later)
  297.     line_goto 100            goto 'flat' line number 100
  298.     buffer_write . no        write the current buffer, no appending
  299.     line_insert "Hello \"Ace\""    insert Hello "Ace" as a new line
  300. /*...e*/
  301.  
  302. /*...scharacter:0:*/
  303. character_left            Move the cursor one character keft.
  304. character_right            Ditto - but right.
  305. character_insert c        Insert character and move right.
  306. character_overtype c        Overtype character over existing one
  307.                 or if at end of line then insert.
  308. character_type c        Either insert or overtype, depending on flag.
  309.                 None of the 3 character entering routines
  310.                 will do anything if supplied the NUL (ASCII 0)
  311.                 character since this is used internally within
  312.                 the program (written in "C").
  313. character_delete_left        Delete the character to the left of the cursor.
  314.                 If the character is no an end of line mark,
  315.                 the character is placed on the deleted stack,
  316.                 along with a flag to say that if it is
  317.                 undeleted then the cursor should move one
  318.                 right afterwards.
  319. character_delete_right        Delete the character to the right of the
  320.                 cursor. If it is not an end of line mark, it
  321.                 is placed on the deleted item stack along
  322.                 with a flag to say that if it is undeleted,
  323.                 simply insert it at the cursor position and do
  324.                 not move the cursor.
  325. character_delete_eol        Delete to end of line. Store the end of the
  326.                 line on the deleted stack.
  327. character_tab            Inserts or overtypes as with either a tab
  328.                 character (^I) or as many spaces as are
  329.                 necessary to pad to the next tab stop.
  330.  
  331. eg:
  332.  
  333. character_type 'A'
  334. character_delete_right
  335. /*...e*/
  336. /*...sstring:0:*/
  337. string_insert s            Insert a string (repeatedly character_insert's).
  338. string_overtype s        Overtype a string (repeatedly
  339.                 character_overtype's).
  340. string_type s            Type a string (repeatedly character_type's).
  341.  
  342. eg:
  343.  
  344. string_insert "Hello World"
  345. /*...e*/
  346. /*...sword:0:*/
  347. word_left            Move left by a word (scope is current fold).
  348. word_right            Ditto - but right.
  349. /*...e*/
  350. /*...sline:0:*/
  351. line_insert string        Insert a new line, text of which is string.
  352. line_insert... string open indent
  353.                 Insert a fold line.
  354. line_insert::: string open indent
  355.                 Insert a virtual fold line.
  356. line_delete            Delete current line (if not last line).
  357.                 Line is put onto deleted line stack.
  358. line_yank            Copy current line and put on stack.
  359. line_up                Move to the previous line in current fold.
  360. line_down            Ditto - but next.
  361. line_start            Move to the start of the line.
  362. line_end            Ditto - but end.
  363. line_goto            Goto a 'flat' line-number.
  364. line_split            Splits line at cursor and move to start of
  365.                 new line
  366. line_trans from to        Convert letters in from to corresponding in to
  367. line_exec            Takes current text line from current buffer
  368.                 and executes it. Good for testing key-bindings.
  369.  
  370. eg:
  371.  
  372. line_insert... "tag" yes 0
  373. /*...e*/
  374. /*...spage:0:*/
  375. page_up                Scroll a page up.
  376. page_down            Ditto - but down.
  377. page_scroll_up            Scroll the visible area up a line.
  378. page_scroll_down        Ditto - but down.
  379. /*...e*/
  380. /*...ssearch:0:*/
  381. search_for pattern case_sens reg_exp ... ::: dir n confirm
  382.                 Search for a pattern, which may or may not be
  383.                 a regular expression, searching in either
  384.                 direction, n times, possibly confirming each's
  385.                 position.
  386.                 Can specify when to enter nested folds and
  387.                 virtual folds.
  388. search_replace pattern replacement case_sens reg_exp ... ::: dir n confirm
  389.                 Ditto - but replace occurences.
  390. search_again            Repeat last search or search and replace.
  391. search_bracket            If currently on a bracket character, find the
  392.                 matching bracket. Scope of search is limited to
  393.                 current fold.
  394.  
  395. eg:
  396.  
  397. search_for ".*\.c" yes yes if_open if_open yes 5 no
  398.  
  399. note:
  400.  
  401. If the search pattern is reg_exp, then the replacement string can use \n
  402. notation to refer to parts of the match in the replacement string.
  403. /*...e*/
  404. /*...stag:0:*/
  405. tag_line            Place/remove a tag on current line.
  406.                 There is no limit on the number of tags that
  407.                 may be inserted into each buffer.
  408. tag_error            Examine current line after cursor and extract
  409.                 a filename and line-number if present. Then
  410.                 if we are editing such a file, place a tag in
  411.                 the file's buffer at the given line number.
  412.                 This is intended for use with the output of
  413.                 the make(1) utility.
  414. tag_goto dir            Move to the next or previous tag in the
  415.                 current buffer.
  416. /*...e*/
  417. /*...sfold:0:*/
  418. fold_start            Move to the first line in the current fold.
  419. fold_end            Ditto - but last.
  420. fold_open open            The cursor must be on a fold line.
  421.                 Make the fold either open or closed.
  422. fold_in                The cursor must be on a fold line.
  423.                 Enter the fold.
  424. fold_out            Leave the current fold and go to its parent.
  425. /*...e*/
  426. /*...sblock:0:*/
  427. block_mark_1            Place marker one at the current line.
  428. block_mark_2            Ditto - but marker two.
  429. block_unmark            Remove both markers.
  430. block_to_mark_1            Move the cursor to the line with the first
  431.                 marker. Do nothing if it is not set.
  432. block_to_mark_2            Ditto - but marker two.
  433. block_fold tag open indent    Create a fold and insert the marked area into
  434.                 it. If there is no marked area, simply create
  435.                 the fold. The tag is a filename with any
  436.                 embedded spaces quoted by preceeding them with
  437.                 a '. Unquoted white space ends the filename. 
  438. block_unfold            The cursor must be on a fold line.
  439.                 Unfold the fold and make the nested lines
  440.                 be marked.
  441. block_entab            For each line in the block, insert a tab at
  442.                 its start. Error if line would become too long.
  443. block_detab            For each line in block starting with a full tab
  444.                 remove the tab.
  445. block_read filename        Read filename into fold and mark as a block.
  446. block_write filename append    Write the marked block to a file, possibly
  447.                 appending to it.
  448. block_filter command        Write marked block to temporary file 1.
  449.                 Run the command with temporary file 1 as
  450.                 its standard input and temporary file 2 as
  451.                 its standard output. Delete marked block.
  452.                 Read in temporary file 2 as the new block.
  453.                 Important: fold information is also written out
  454.                 for any nested folds. Therefore, if you pass
  455.                 a fold through 'sort' the folding structure of
  456.                 the file would almost certainly be corrupted. #
  457.                 This takes a copy of the 'before' block on the
  458.                 deleted item stack.
  459. block_delete            Delete currently marked block. Put on deleted
  460.                 item stack. If this is subsequently undeleted,
  461.                 the resulting lines will be re-marked as a
  462.                 block.
  463. block_yank            Put a copy of the current block on the deleted
  464.                 item stack.
  465. block_trans from to        Convert letters in from to corresponding in to
  466.  
  467. /*...sproblems with block_filter:0:*/
  468. # This is a problem caused by the way fold information is stored in the file.
  469.   eg:
  470.  
  471. The fold used as the argument    File before "sort"    File after "sort"
  472.  
  473. {{{ this fold            /*...sthis fold:0:*/    contents
  474.     contents        contents        /*...e*/
  475. }}}                /*...e*/        /*...sthis fold:0:*/
  476.  
  477. Note that the resulting file has its end reserved comment before its start!
  478. If you passed the above file through an "uppercaseifier" then you would
  479. find that the reserved comments would be "uppercaseified" as well. In the
  480. reserved comment ...s implies closed fold, ...S would imply open. Therfore
  481. such a command would, as a side effect, open all nested folds! Moral: only
  482. use block filter on text, unless you know the program knows about folding.
  483. /*...e*/
  484. /*...e*/
  485. /*...sbuffer:0:*/
  486. buffer_create filename read select
  487.                 Create a new buffer of name filename.
  488.                 If read requested, read it in too.
  489.                 If select requested, select the buffer too.
  490. buffer_delete filename        Delete the buffer and its contents.
  491.                 Do not delete the file.
  492. buffer_select filename        Select a buffer for editing.
  493. buffer_rename filename filename    Change the name of a buffer.
  494. buffer_read filename        Read in the file into its buffer.
  495. buffer_write filename append    Write the buffer to its file.
  496.  
  497. eg:
  498.  
  499. buffer_write . no
  500. /*...e*/
  501. /*...slanguage:0:*/
  502. language_create langname rc_st rc_end match visible auto insert_mode tab seps
  503.                 Create a language which has reserved comments
  504.                 rc_st and rc_end, matches filenames with an
  505.                 extended regular expression, possibly
  506.                 has autoindent, and has a tab size of tab.
  507.                 The seps string determines what characters,
  508.                 apart from white space seperate words.
  509.                 as making up a word. eg: for "C" use "_" since
  510.                 identifiers may contains _'s.
  511. language_delete langname    Delete a language.
  512. language_select langname    Change the language of the current buffer.
  513. language_rename langname langname
  514.                 Change the name of a given language.
  515.  
  516. eg:
  517.  
  518. language_create "pascal" "{..." "}" ".*\.pas" no yes yes 0 "_"
  519. /*...e*/
  520. /*...ssetup:0:*/
  521. setup_visible            Toggle the character visibility flag.
  522.                 Determines how white space, control characters,
  523.                 and other characters are shown on the screen.
  524. setup_autoindent        Toggle the autoindent flag.
  525. setup_insert            Toggle the insert/overtype flag.
  526. setup_tabs            Modify the tab size.
  527. /*...e*/
  528. /*...skey:0:*/
  529. key_prefix key_name        This is used to allow multiple key bindings.
  530.                 eg: to get wordstar like block bindings
  531.                     you should use key_prefix "^K".
  532. key_bind key_name(s) stuff_to_end_of_line
  533.                 Make key key_name(s) execute the commands on the
  534.                 rest of the line each time it is pressed.
  535.                 If the first key_name is a prefixed key then
  536.                 a second key name will be expected, to complete
  537.                 the binding.
  538.  
  539. eg:
  540.  
  541. key_bind "^B ^S" "buffer_select ?"
  542. /*...e*/
  543. /*...sother:0:*/
  544. other_shell command        Execute subprocess command.
  545. other_redraw            Redraw the entire screen.
  546. other_exit confirm        Leave Andys Editor. You will be prompted
  547.                 about saving edited buffers.
  548. other_abort confirm        Leave Andys Editor. No prompts.
  549. other_undelete            Last deleted item is replaced at cursor
  550.                 position into the text.
  551. other_put            Last deleted item is copied from deleted item
  552.                 stack to text.
  553. other_squeeze            Discards deleted stack to free up memory.
  554. other_colours t f s mt mf ms    Set the colours used by the editor for
  555.                 the text, fold lines, status information and
  556.                 also their marked counterparts. These numeric
  557.                 values used for the arguments vary from
  558.                 machine to machine.
  559. other_backups backup        enable or disable making backups
  560.  
  561. eg:
  562.  
  563. other_shell "ls -al"
  564. /*...e*/
  565. /*...sconditional:0:*/
  566. When AE processes its initialisation file, it can skip certain commands
  567. depending upon the platform the editor is running on. This is acheived by
  568. dollar directives, like in the following :-
  569.  
  570.     $U
  571.     key_bind "F11" "block_write \"/tmp/ae1.cut\""
  572.     $P
  573.     key_bind "F11" "block_write \"c:/tmp/ae1.cut\""
  574.     $*
  575.  
  576. $U, means execute the following lines if on a type of UNIX. $P means on a type
  577. of PC (ie: DOS, OS/2, or Windows version). $O is a sort of a catch all for
  578. any other type of machine. $* means execute what follows on any type of
  579. machine. Letters can be combined, so $UO means UNIX or other (but not PC).
  580. /*...e*/
  581. /*...e*/
  582. /*...sdefault key bindings:0:*/
  583. The configuration file is accessable from these virtual folds (provided you
  584. are currently in the right directory).
  585.  
  586. /*...vae\46\ini:0:*/
  587.  
  588. Any line in these files starting with a ; is ignored by the editor. Any other
  589. line is executed as-is by the editor at load time only. AE makes no attempt to
  590. re-read this file after it has been edited. Any line in these files may be fed
  591. to AE directly by pressing escape and typing in the line as a command (except
  592. for comment lines).
  593. /*...e*/
  594. /*...sae file format:0:*/
  595. This section is provided to allow people to write tools (including other
  596. folding editors) that understand the folded file format.
  597.  
  598. The editor deduces the language of the file from the filename via the
  599. extended regular expression specified in the languages language_create
  600. statement which is usually done in the initialisation file.
  601.  
  602. eg: For "assembler", the extended regular expression ".*\\.(s|i|asm|inc|mac|as)"
  603.     is used to say all .s, .i, .asm,... etc. files are "assembler" files.
  604.  
  605. Also defined per language is <rc_st> and <rc_end> strings (reserved comment
  606. start and end). <rc_st> is the most common comment introducer for the language,
  607. followed by <unlikely> and <rc_end> is the comment completor (if required).
  608.  
  609. <unlikely> is a string the user is unlikely start a comment with. In practice
  610. for all currently defined languages "..." is used, and is recommended for any
  611. new languages, unless it is not allowed, in which case something else will do.
  612.  
  613. eg: For "pascal", the most common comment starter is "{", and ender is "}".
  614.     Hence <rc_st> is "{..." and <rc_end> is "}".
  615.  
  616. eg: For "assembler", comments start with ";" and need no ender.
  617.     Hence <rc_st> is ";..." and <rc_end> is "".
  618.  
  619. A text file is an ordered list of lines. If a line begins with <rc_st> in
  620. column 1, then it is considered to be a 'crease'. Crease types defined are :-
  621.  
  622.     <rc_st>s<tag>:<indent>:<rc_end>    begin closed fold, shown as "... tag"
  623.     <rc_st>S<tag>:<indent>:<rc_end>    begin open fold, shown as "{{{ tag"
  624.     <rc_st>e<rc_end>        end fold
  625.     <rc_st>E<rc_end>        end fold, shown as "}}}"
  626.     <rc_st>v<tag>:<indent>:<rc_end>    closed virtual fold, "::: tag"
  627.     <rc_st>V<tag>:<indent>:<rc_end>    open virtual fold, ">>> tag"
  628.  
  629. Any other letter after <rc_st> is reserved for future use and is an error.
  630.  
  631. Begin fold and end fold creases must nest correctly and all match up properly
  632. within a text file. Consider them much like brackets.
  633.  
  634. ( Aside: You might note than end fold can be either 'e' or 'E'. The "}}}" is
  635. shown by the editor if it pairs with a 'S', not whether it is an 'E' ).
  636.  
  637. <tag> is a fold or virtual fold tag. The user may type in any character codes
  638. to make up the <tag>. Alphanumeric, '_' and ' ' characters are represented in
  639. the <tag> as-is, but anything else gets mapped to '\' followed by decimal
  640. ASCII code followed by '\'.
  641.  
  642. eg: The fold tag "Hypen-ated" is represented in the file by "Hypen\45\ated"
  643.  
  644. For virtual folds (which are essential just references to another file),
  645. the first part of the <tag> upto the first space or tab character is considered
  646. to be the filename, the rest is disregarded when entering a virtual fold.
  647.  
  648. eg: Entering virtual fold with <tag> of "sort.c - do sorting" will attempt
  649.     to load the file "sort.c".
  650.  
  651. <indent> represents the columnar indent of the contents of the fold being
  652. begun from the beginning of the file. Therefore it is an error if the <indent>
  653. value for a nested fold is less than the <indent> of its parent. Looking back,
  654. it might have been better to make +ve and <indent> relative to its parent.
  655.  
  656. Example of what is in a sample file, what it represents :-
  657.  
  658.     <---- column 1
  659.  
  660.     #include "check.h"        #include "check.h"
  661.     /*...vcheck\46\h:0:*/        ::: check.h
  662.     static void check(void)        static void check(void)
  663.         {                {
  664.         if ( condition )        if ( condition )
  665.     /*...Sdie:16:0*/                {{{ die
  666.     {                        {
  667.     /*...Vwhywarn\46\txt:16:*/            >>> whywarn.txt
  668.     warn();                        warn();
  669.     exit(1);                    exit(1);
  670.     }                        }
  671.     /*...e*/                    }}}
  672.         }                }
  673.  
  674. If the die fold used little 's' not big 'S', then the fold would be closed and
  675. shown by the editor as "... die" only on the right, until the fold is entered.
  676.  
  677. There is no explicit limit to the levels of nesting allowed. In practice, many
  678. of AEs internal functions are written recursively, so it is possible to blow
  679. the (very large) stack. I envisage a least 500 levels being safe. In practice,
  680. users don't tend to nest much more than 10 levels, so this is not a problem.
  681. /*...e*/
  682. /*...smisc stuff:0:*/
  683. /*...sadding to AE:0:*/
  684. Probably the easiest way of "adding" functionality to AE is to write a small
  685. filter program and to bind a key like so :-
  686.  
  687.     key_bind "^R" "block_filter \"reform -\""
  688.  
  689. The example uses a program reform to reformat a block. The program reform is
  690. simply a filter that reforms its standard input to its output. This paragraph
  691. itself was formatted using the very same key-binding.
  692.  
  693. Other filters could supply 'line-drawing-mode', 'white space stripping'.
  694.  
  695. Note that such filters could cause problems if you send folds through them.
  696. /*...e*/
  697. /*...smachines supported:0:*/
  698. The editor is written in portable "C" and may easily be ported to new machines,
  699. provided they have suitable screen and keyboard control.
  700.  
  701. The only things that change from version to version are filename
  702. conventions, available keys for binding, colour support, and support
  703. for screen sizes and modes.
  704.  
  705. /*...sfilenames:0:*/
  706. On systems with forward slash pathname seperators (UNIX),
  707. backslashes in filenames get converted to forward slashes.
  708. On systems with backward slashes as pathname seperators (DOS, OS/2 and
  709. Windows), forward slashes in filenames get converted into backward slashes.
  710. After translation, the filenames get passed to the operating systems.
  711.  
  712. The DOS AE is limited to 8.3 filenames, but the OS/2 and Windows
  713. versions support long filenames. Of course, UNIX does too.
  714. /*...e*/
  715. /*...skeyboard:0:*/
  716. Keyboard support table :-
  717.  
  718. Keys                   DOS OS/2 Windows UNIX
  719. ---------------------- --- ---- ------- ----
  720. ^A-^Z ^\ ^] ^^ ^_      yes yes  yes     yes
  721.  Left  Right  Up  Down yes yes  yes     yes #1
  722. ~Left ~Right ~Up ~Down -   -    -       yes #2
  723. ^Left ^Right ^Up ^Down yes yes  yes     yes #2
  724. @Left @Right @Up @Down yes yes  yes     yes #2
  725.  Home  End  PgUp  PgDn yes yes  yes     yes #2
  726. ~Home ~End ~PgUp ~PgDn -   -    -       yes #2
  727. ^Home ^End ^PgUp ^PgDn yes yes  yes     yes #2
  728. @Home @End @PgUp @PgDn yes yes  yes     yes #2
  729. @A-@Z @0-@9 @- @=      yes yes  yes     yes #2 #3
  730.  F1- F12               yes yes  yes     yes #1 #4
  731. ~F1-~F12               yes yes  yes     yes #2 #4
  732. ^F1-^F12               yes yes  yes     yes #2 #4
  733. @F1-@F12               yes yes  yes     yes #2 #4
  734.  
  735. #1: Subject to AE recognising the terminal type being used, and the
  736. type having a termcap/terminfo database entry with suitable entries in it.
  737.  
  738. #2: Subject to AE recognising the terminal type being used, and the
  739. type being one for which AE has hard coded knowledge
  740. (vtxxx, xterm, aixterm or hft).
  741.  
  742. #3: AE has specific hard coded knowledge of the escape sequences
  743. generated for the Alt keys by the linux terminal.
  744.  
  745. #4: Xenix only supported 10 function keys the last time AE was
  746. compiled for it.
  747.  
  748. A few other obscure keycodes are also supported.
  749.  
  750. On DOS, OS/2 and Windows, searches can be interrupted using the
  751. ^Break key. On UNIX its the Esc key.
  752.  
  753. /*...sSpecial notes for UNIX:0:*/
  754. The most basic level of keyboard support provided by termcap/terminfo
  755. is support for Left, Right, Up, Down, and for function keys F1-F10.
  756. If the termcap/terminfo database is incomplete, or your TERM environment
  757. variable is wrong, then even this most basic level of support may not work
  758. fully or at all.
  759.  
  760. AE for UNIX has a special 'feature' whereby pressing Esc followed by a key
  761. is logically equivelent to pressing Alt and the key together. This helps out
  762. in situations where the Alt keys do not make it to programs, perhaps because
  763. the terminal emulator or windowing system won't pass them on.
  764.  
  765. ^S and ^Q can be a problem if operating with xon/xoff flow control.
  766. ^Y and ^Z are often the suspend and delayed suspend keys on a terminal.
  767.  
  768. /*...sDEC terminals:0:*/
  769. AE specifically knows the escape sequences for arrows
  770. (application and cursor mode) and function keys (F1-F4) in the VT100
  771. terminal (and family) definition.
  772.  
  773. AE specifically knows the escape sequences generated by function keys in
  774. an xterm session.
  775.  
  776. It does this as emulators/terminals and/or terminfo/termcap definitions
  777. often get the distinction between application and cursor mode wrong.
  778. /*...e*/
  779. /*...sIBM terminals:0:*/
  780. AE knows the escape sequences for masses of keys from
  781. the IBM aixterm and IBM hft terminals.
  782. It even knows the variations generated by IBM Internal tool
  783. HFTTERM.EXE for OS/2. Excellent keyboard support can be obtained using these.
  784.  
  785. The following additions to your ~/.cshrc file will
  786. improve Ctrl key support, by avoiding the flow control and suspend
  787. key problems explained above :-
  788.  
  789.   stty -ixon -ixoff   # Disable ^S ^Q flow control
  790.   stty susp undef     # ^Y no longer suspends
  791.   stty dsusp undef    # ^Z no longer suspends
  792.  
  793. Note that if you are working on an X-Station, then depending upon your
  794. window manager, some of the keys may be intercepted before AE sees them.
  795. For example, when I run the Motif-Window-Manager, mwm, I find
  796. that @F4 is intercepted before AE sees it, and it is used to
  797. close the aixterm window.
  798. /*...e*/
  799. /*...sLinux terminal:0:*/
  800. AE knows some of the escape sequences generated for keystrokes from the
  801. linux terminal.
  802. /*...e*/
  803. /*...sDefault Sun terminal:0:*/
  804. The left-function keys (L1-L10)
  805. are known to AE as the Alt+Fn keys @F1-@F10.
  806.  
  807. The right-function keys are arranged with the following mapping
  808. (as the Sun keyboard doesn't actually have arrow-keys) :-
  809.  
  810.   R7  = Home    R8  = Up      R9  = PgUp
  811.   R10 = Left                  R12 = Right
  812.   R13 = End     R14 = Down    R15 = PgDn
  813. /*...e*/
  814. /*...sDefault Xenix terminal:0:*/
  815. Xenix supports 10 function keys.
  816.  
  817. The @Fn keypresses are intercepted by the Xenix
  818. multi-terminal system and are used to switch between sessions.
  819.  
  820. If the user presses ^~Fn, then AE sees this as @Fn.
  821. /*...e*/
  822. /*...e*/
  823. /*...e*/
  824. /*...scolour:0:*/
  825. Colour support table :-
  826.  
  827. Colour                      DOS OS/2 Windows UNIX
  828. --------------------------- --- ---- ------- ----
  829. 8 foreground / 8 background yes yes  yes     yes #1 #2 #3
  830. Bright foreground           yes yes  yes
  831. Bright background                    yes
  832. Flash                       yes yes
  833.  
  834. #1: Under AIX, if the termcap/terminfo entry supports it, and you are running
  835. on a vtxxx, aixterm or hft terminal, then colour support is enabled.
  836. I've seen a VT100 terminal terminfo definition on AIX which doesn't
  837. support colour, although I see no reason why this can't easily be remedied.
  838.  
  839. #2: Under Linux or HP/UX, if the termcap/terminfo entry supports it, colour
  840. support is enabled.
  841.  
  842. #3: Most terminals don't have colour support, and for these the standard
  843. curses support is simply for one of 4 'colours' (none, some or all of which
  844. may be supported by your particular terminal) :-
  845.  
  846.   Normal    = 0
  847.   Underline = 1  support for this often not present
  848.   Standout  = 2  this is usually inverse or bold
  849.   Alternate = 3  this could be an alternate character set
  850.  
  851. However, in the general case, given the following defines :-
  852.  
  853.   Black   = 0   Flashing = 1
  854.   Blue    = 1   Static   = 0
  855.   Green   = 2
  856.   Cyan    = 3
  857.   Red     = 4
  858.   Magenta = 5
  859.   Yellow  = 6   Bright    = 1
  860.   White   = 7   NotBright = 0
  861.  
  862. Colour values may be computed as :-
  863.  
  864.   DOS, OS/2 :  value = fg + bg*16 +    bright*8 +     flash*128
  865.   Windows   :  value = fg + bg*16 + fg_bright*8 + bg_bright*128
  866.   UNIX      :  value = fg + bg*16 + fallback_one_of_4_colours*256
  867.  
  868. Clearly the portable approach is simply to avoid using flashing and/or
  869. bright colours. Luckily hex notation (introduced by a & symbol) can be used
  870. to specify numbers, including colours.
  871. /*...e*/
  872. /*...sscreen modes:0:*/
  873. AE for DOS supports a wide variety of CGA, EGA, VGA and Super VGA screen
  874. modes, including various 43,50 and 60 line modes, and also 132 columns modes.
  875. It draws upon the services of the DOS Terminal Handler for its screen handling.
  876.  
  877. AE for OS/2 can operate in any mode provided by the Vio
  878. interface, including the Super VGA modes detected by the SVGA.EXE
  879. utility and stored in the SVGADATA.PMI file.
  880. This includes the 132 column modes on XGA-2 for example.
  881.  
  882. AE for Windows is a regular Console application, and so will work in
  883. any of the screen modes supported by Windows.
  884.  
  885. AE for UNIX cannot change the screen/window size, and so
  886. simply runs with however many lines and columns are currently available.
  887. /*...e*/
  888. /*...e*/
  889. /*...sbugs\44\ problems:0:*/
  890. At this present time, AE for UNIX cannot differentiate between foreign
  891. language keystrokes, such as a-with-unmlaut and Alt-characters. Both such
  892. keystrokes generate keycodes in the range 0x80 to 0xff. Curses does not
  893. appear to give me a way of telling the difference.
  894.  
  895. Also, AE for UNIX cannot display characters which do not satisfy the ctype.h
  896. isprint(c) macro, as curses cannot promise that doing so will not upset your
  897. terminal screen. So even if you could type a-with-umlaut, AE couldn't show it!
  898. /*...e*/
  899. /*...scopying this editor:0:*/
  900. This editor is all my own work.
  901. I hereby place it in the Public Domain.
  902. Do what you like with it.
  903. Please redistribute it as you received it.
  904. Please don't try to sell it.
  905. Please don't try to place restrictions on what others can do with it.
  906. This software is supplied as-is, with no guarantee.
  907. /*...e*/
  908. /*...srevision history:0:*/
  909. Significant and recent revisions are only listed. If you have a version between
  910. listed dates, it will have some of the problems listed. You should always
  911. upgrade if you can.
  912.  
  913. 15/1/89        Initial version (Alpha-Test).
  914.  
  915. Various dates:    Many minor bugfixes and various speed increases.
  916.         Extremely extensive testing (4 years worth)!
  917.         Brought OS/2, DOS, AIX and UNIX versions closer together.
  918.         Many releases to university and work collegues.
  919.  
  920. 1/5/93        Made Public Domain.
  921.         First official external release to Internet.
  922.  
  923. 1/7/93        Added readonly file test to UNIX versions.
  924.         Fixed backup filename of "../.login" etc..
  925.         Improved tag_error to work with "filename.ext", line NUM.
  926.  
  927. 29/3/94        Converted all source to fully prototyped form.
  928.         Made source tree structure much safer.
  929.         Compilable with IBM C-Set++ for 32 bit OS/2.
  930.         Language redefinition fix.
  931.         Comments at ends of lines in .INI files now allowed.
  932.  
  933. 1/11/94        Bugfix for append mode.
  934.         Bugfix for VESA support in DOS version.
  935.         Added HTML language in supplied .INI file.
  936.  
  937. 1/4/95        Added default key bindings, if .INI file not found.
  938.         Replaced Norton Guide with HTML documentation.
  939.  
  940. 9/4/96        Added Win32 version.
  941.  
  942. 14/6/96        Added support for filename case preservation on OS/2 and Win32.
  943.         Added Java language definition.
  944.  
  945. 3/3/97        Migration from IBM C-Set++ to IBM VisualAge C++ with CTC305.
  946.         Bugfix for illegal Extended Regular Expressions.
  947.         Fixed read-only file saving on 32 bit OS/2 version.
  948.         HTML documentation is now on the web, not in the package.
  949.  
  950. 1/5/97        Added other_backups.
  951.  
  952. 1/1/98        Extended max languages and buffers.
  953.         Worked around Windows 95 Console API bugs.
  954.         Added support for other screen sizes to Win32 version.
  955.  
  956. 1/5/98        Increased number of key bindings from 150 to 250.
  957.         Rationalised UNIX terminal support.
  958.         Added Esc then X equivelent to Alt+X.
  959.         Added Linux version.
  960.         AIX version built on AIX 4.1 machine (rather than 3.2.5)
  961.         Misc UNIX keyboard improvements.
  962.         Fixed (widened) valid UNIX filename checking. 
  963.  
  964. 1/7/98        Improved Extended Regular Expression support.
  965.  
  966. 1/8/98        Hex numbers, initial HP/UX and Solaris versions.
  967.  
  968. 1/9/98        setup_visible affects ctrl and other characters too now.
  969.         Avoid display of chars >= 0x80 on UNIX, its unsafe.
  970.         Conditional processing of initialisation file.
  971.  
  972. 1/11/98        Escape ' mechanism for spaces in filename and virtual folds.
  973.         Support for UNC \\server\share\path\file.ext filenames on PCs.
  974. /*...e*/
  975. /*...sobtaining this editor:0:*/
  976. The easiest way to obtain this program is via the links on my homepage(s).
  977. /*...e*/
  978. /*...scontacting the author:0:*/
  979. {{{ Andy Key
  980.  
  981. Email    : nyangau@interalpha.co.uk
  982. Homepage : http://www.interalpha.net/customer/nyangau/
  983.    (IBM) : http://grob.ssd.hursley.ibm.com/
  984. /*...e*/
  985. /*...e*/
  986.