9.5;bl (balance) *DM*, revision 9.5, 86/11/04
BL (BALANCE) -- Balance delimiters.
usage: [range]BL [-I|-C] [l_char] [r_char]
FORMAT
[range]BL [-I | -C] [l_char] [r_char]
BL determines whether a given pair of delimiting characters (for instance,
left and right parentheses) is balanced within a specified range of text.
ARGUMENTS
range
(optional) Specify range of text to be checked. This argument is valid
only when used with -C; the range for -I is the current
cursor position to the end (or beginning) of the file.
Define the range to be checked as described in HELP DM
RANGE.
Default if omitted: check from cursor to end of line
l_char
(optional) Specify the left delimiting character. If 'r_char' is
specified but this argument is omitted, the left delimiting
character defaults to 'r_char'. If both arguments are
omitted, the left delimiting character defaults to left
parenthesis.
r_char
(optional) Specify the right delimiting character. If 'l_char' is
specified but this argument is omitted, the right
delimiting character defaults to 'l_char'. If both
arguments are omitted, the right delimiting character
defaults to right parenthesis.
OPTIONS
If either of the following options is specified, it must precede any specified
arguments.
Default options are indicated by "(D)."
-I (D) Insert mode: search for balanced delimiters from the
current character to the beginning or end of the file. The
behavior of BL depends upon the character under the cursor
when BL is invoked.
If you position the cursor on a delimiter and BL finds a
balancing delimiter, it moves the cursor to the matched
character momentarily (to show you where the balance is
completed), then returns the cursor to the character
immediately following the initial cursor postion. The
search direction is forward if the character under the
cursor is a left delimiter, and backward if the character
is a right delimiter.
If you position the cursor on a delimiter and BL finds no
balancing delimiter, it gives an error message and sounds
the alarm, then inserts a matching right delimiter at the
initial cursor position.
If you position the cursor on a character other than a
delimiter, BL searches backward for the first occurrence of
'l_char', briefly shows you where it is, then inserts a
matching right delimiter at the initial cursor position.
-C Check mode: check only -- do not insert balancing
characters or move the cursor. You may mark a range of
text to be checked if you specify this option; see the
'range' argument above. BL checks all pairs of specified
delimiters within the specified range. Results of the
check are displayed in the DM message window.