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