Functions can be used to manipulate variables in various ways. Functions have in general one, two, or three arguments. These arguments will always be placed after the function on the current command line. For example, if we wanted to increase the current fill column by two, using MicroEmacs '99's set-variable(2) (C-x v) command, we would write:
set-variable $fill-col &add $fill-col 2 \ \ \ \ \____second operand \ \ \ \_________first operand \ \ \________________function to execute \ \______________________variable to set \__________________________________set-variable (C-x v) command
Functions always begin with an ampersand (&) character, and are only significant to the first 3 characters after the ampersand. Functions will normally expect one of three types of arguments, and will automatically convert types when needed.
<num>
<str>
<log>
A list of the currently available functions follows:
Numeric Functions (returns <num>)
&abs(4) Absolute value of a number
&add(4) Add two numbers
&dec(4) Pre-decrement variable
÷(4) Division of two numbers
&inc(4) Pre-increment variable
&mod(4) Modulus of two numbers
&multiply(4) Multiply two numbers
&negate(4) Negation of two numbers
&pdec(4) Post-decrement variable
&pinc(4) Post-increment variable
&sub(4) Subtract two numbers
Bitwise Functions (returns <num>)
&band(4) Bitwise AND operator
&bnot(4) Bitwise NOT operator
&bor(4) Bitwise OR operator
&bxor(4) Bitwise XOR operator
String manipulation functions (returns <str>)
&cat(4) Concatenate two strings together
&left(4) Return the left most characters from a string
&len(4) Return the length of a string
&mid(4) Return a portion (middle) of a string
&right(4) Return the right most characters from a string
&slower(4) Return the string converted to lower case
&sprintf(4) Formatted string construction
&supper(4) Return the string converted to upper case
&trboth(4) Return string trimmed of white chars on both sides
&trleft(4) Return string trimmed of white chars on left side
&trright(4) Return string trimmed of white chars on right side
List manipulation functions (returns <str>)
&ldel(4) Delete list item
&lfind(4) Find list item
&lget(4) Get list item
&linsert(4) Insert list item
&lset(4) Set list item
Logical testing functions (returns <log>)
&and(4) Logical AND operator
&equal(4) Numerical equivalence operator
&great(4) Numerical greater than operator
&isequal(4) Case insensitive String equivalence operator
&less(4) Numerical less than operator
¬(4) Logical NOT operator
&or(4) Logical OR operator
&sequal(4) String equivalence operator
&sgreat(4) String greater than operator
&sless(4) String less than operator
&xisequal(4) Case insensitive regexp String equivalence operator
&xsequal(4) Regexp string equivalence operator
Miscellaneous functions
&atoi(4) ASCII to integer conversion
&bmode(4) Determine buffer mode
&cond(4) Conditional expression operator
&exist(4) Test if a variable or command exists
&find(4) Find a file on the search path
&gmode(4) Determine global mode
&indirect(4) Evaluate a string as a variable
&inword(4) Test for a word character
&isin(4) Case insensitive test for string in string
&itoa(4) Integer to ASCII conversion
&kbind(4) Return command key binding
&nbmode(4) Determine named buffer mode
&risin(4) Recursive case insensitive test for string in string
&rsin(4) Recursively test for string in string
&set(4) In-line macro variable assignment
&sin(4) Test for string in string
&stat(4) Retrieve a file statistic
&which(4) Find a program on the path
Directives
(c) Copyright JASSPA 1999
Last Modified: 1999/12/01
Generated On: 1999/12/01