home *** CD-ROM | disk | FTP | other *** search
INI File | 1995-08-24 | 3.8 KB | 67 lines |
- [THIS FILE IS MACROS.HLP]
- After you have defined and keybound a few macros and buffers, an example of
- AAEMACS macrofile format can be got by going to a spare buffer and typing 'alt-X
- prmacros' and 'alt-X boundbuffers'. As in C, statements end in ';' and can run
- onto the next line, and several statements can go on the same line.
- I recommend the suffix '.AMB' for AAEMACS macro-and-bufferloading files.
- An ordinary command is the name of a routine (see HELP.BIG), followed perhaps
- by arguments in (round brackets) separated by commas. They can only be within
- macros, and are obeyed when the macro is called. They do not start with '#'.
- If the first argument is an integer, it is used when calling the routine,
- like 'esc number' and 'alt_numbers' before a key code, and is called N in the
- information in files HELP and HELP.BIG .
- Some routines want other arguments also: a string, or two strings, or a
- keysequence. If omitted, the routine will ask the user for this information
- when it is called.
- A string is "" with zero or more characters between. ^ before a letter or any
- of [\]^_ means `ctrl-'. ^M is end-of-line. \ followed by 3 octal digits means
- the character with that ASCII octal number, as in C. ^@ is ASCII-zero. ` before
- a character means that that character is magic (i.e. has a special meaning). To
- express ^ and " and \ and ` themselves, put \^ and \" and \\ and \`
- Pressing alt# gets a menu of the currently defined macros.
- For keyseq, see under 'functions' below.
-
- Commands starting with # are obeyed when the macro file is read:-
- #beginmacro Start the current macro which is called by 'ctrl-X E'.
- #beginmacro(keyseq(--)) Start a macro & bind it to the keysequence specified.
- #beginmacro("--") Ditto, but also callable like a keyfunction using the
- #beginmacro("--",keyseq(--)) name which here is the 1st arg of beginmacro.
- #endmacro End the macro which is being read.
- #unbindkey(keyseq(--)) Unbind the key sequence specified.
- #buffer("--") Read that file into a buffer, like ctrl-X ctrl-F does.
- #buffer("--",keyseq(--)) Ditto, and bind that buffer to the key seq specified.
-
- A macro line can be:- <routine call> or <expression> or <declaration>.
- An expression is a name, or a string, or a signed or unsigned integer number,
- or a function call, or an operation.
-
- [DECLARATION LINES]:-
- Names contain letters &/or numbers &/or '_', but not number first. These
- lines inside macros declare local variables, and outside macros declare global
- variables. 'altX readmacros' first removes all current global variables.
- int -,-,-; 1 or more args, all names. Declares them as integer variables.
- string -,-,-; 1 or more args, all names. Declares them as string variables.
-
- [FUNCTIONS]:-
- currentbuffer 0 args. Returns a string = full name of current buffer.
- keyseq(-,-,-) 1 or more args, all literal characters or names of keys (see
- file INFO.DAT). These should form a legal key sequence. Returns this
- keysequence as a 'keyseq' type value.
-
- [OPERATIONS]:-
- <variable> = <expression> is assignment.
- ( ) + - * / = != == < > <= >= are as in C.
- Values are integer (except for '=' with string type arguments).
- Allowed operator uses can be found by typing ctrl-_ and then o
-
- [LABELS]:-
- Labels are a name followed by a colon, as in C. Global labels are not allowed.
- Jumps to labels are by the subroutine goto(....), whose argument is a label.
- goto(..) does nothing if the label has not been defined.
-
- [CONDITIONS]:-
- The 1st argument of the subroutine if(-,-,-) is integer; the 2nd and
- (optional) 3rd can be anything. If that integer is not zero, the 2nd argument is
- obeyed; else the 3rd argument (if any) is obeyed. For e.g."if not X, goto Y",
- write `if(X,1,goto(Y));': the `1' is a place-holder for the 2nd argument.
-