home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR36
/
KEXX.ZIP
/
INDENT.DOC
< prev
next >
Wrap
Text File
|
1992-12-30
|
7KB
|
188 lines
INDENT.KEX Documentation
(December 1989)
The auto indentation package currently consists of three separate parts:
**** Regular indentation support.
This consists of several keydefs that support moving the left margin around
with different tab functions.
TAB - moves the cursor forward to the next tab stop, then sets left margin
to the destination.
SHIFT-TAB - moves the cursor backward to the last tab stop, then sets left
margin to the destination.
CTL-I - CTL-INDENT - Set left margin to the cursor position.
CTL-U - CTL-UNDENT - Put the cursor in column 1 and set the left margin to
column 1
ALT-TAB - moves the cursor forward to the last tab stop. then sets the left
margin to the destination.
Next the contents of the line are shifted so that the first non
blank character is placed at the cursor position. If the cursor
is located on the first line in a line block, the entire block is
shifted.
CTL-TAB - moves the cursor backward to the last tab stop. then sets the left
margin to the destination.
Next the contents of the line are shifted so that the first non
blank character is placed at the cursor position. If the cursor
is located on the first line in a line block, the entire block is
shifted.
CTL-HOME - The contents of the line are shifted so that the first non
blank character is placed at the cursor position. If the cursor
is located on the first line in a line block, the entire block is
shifted. The left margin is set to the cursor position. No tab
function is performed.
The tab direction for ALT-TAB and CTL-TAB is based on their relative position on
the extended keyboard, making it easier to remember which way they go.
Regular indenting is enabled only for those extensions you wish by executing the
RINDENT macro in your PROFILE.KEX with the desired file extensions, separated by
semicolons, as an argument. For example:
'macro rindent c;h;rex;kex;kml'
would enable the RINDENT functions for .c, .h, .rex, .kex, and .kml files.
RINDENT.KEX needs to load RINDENT.KML, and must be able to find it.
**** Smart indenting
One big macro that gets attached to the NUMENTER key on the extended keyboard.
It adds a line and tries to intelligently place the cursor and left margin based
on the contents of the file.
There is currently only support for: the C language or REXX or KEX.
It is acivated in the same fashion as the regular indenting package, via a
similar macro in your PROFILE.KEX file:
'macro sindent c;h;cpp;rex;kex;kml;cmd'
As with the regular indenting support macro, SINDENT.KEX will try to load
SINDENT.KML, and must be able to find it.
**** TINDENT.KML - bracket matching and template completion for the C language,
as well as DO/END matching for REXX/KEXX programs.
These functions try to anticipate your needs and provide templates for standard
C statements, or automatically providing ending brackets or END statements. The
effected keys are:
NUMENTER - when pressed, it will try to handle bracket and DO/END completions.
SPACE - when pressed, it will try to intelligently provide "fill in"
statement templates.
CTL-T - Toggles the SPACE function on and off.
Templates for C programmers include:
else
else if ()
if ()
while ()
for ()
switch ()
case :
break;
default:
return;
If you want the functions associated with template completion, all you need to
do to enable them is issue a macro very much like what you've done for the
regular and smart indentation stuff:
'macro tindent c;h'
By default, the SPACE bar functions are toggled off, and you would have to press
CTL-T to enable them. If you decide that you prefer to have the SPACE bar
functions turned on initially, you can also place the following line in your
PROFILE.KEX:
'Editv Setf IEscape OFF'
You can also use a special INDENT.KEX macro to control the way that KEDIT
indents for different file extensions. INDENT.KEX takes four arguments: the
file extension, followed by three different numeric values. They are separated
from one another with blanks. The first value controls the indenting of any
hanging opening brackets. It tells KEDIT how many tab stops in from beginning
of the corresponding control statement you want the bracket to be placed. The
third value is used to help KEDIT place the corresponding closing bracket;
again, the value corresponds to the number of TAB stops in from the beginning of
the appropriate control line. The second value, much like the others, is used
to determine the number of tab stops to indent any time it is appropriate. This
includes, but is not restricted to, the statements that would lie between
opening and closing braces.
Let's consider the case where you want the braces to lie even with the
controlling statements, but want the lines in between to lie one tab stop
over from them. The command you would use to set this up would be:
'macro indent c 0 1 0'
If your tabs settings are set for every four columns, then KEDIT's smart
indenting and template completion would then produce structure that looks
like:
if (a == b)
{
c = d;
}
The default for C programs is: 1 1 1, which would produce:
if (a == b)
{
c = d;
}
For REXX programs, only the second and third values are used by the indenting
logic. The third value controls the placement of any matching END statements,
while the second value works exactly the same as for C programs. If you
prefer to have your structures look like this:
IF a = b THEN DO
x = y
END
then the command should be:
'macro indent 0 1 1'
On the other hand, if you prefer
IF a = b THEN DO
x = y
END
you would specify:
'macro indent 0 1 0'
The default setting for any file extension not overridden in this fashion
is 1 1 1.
*** Note that negative values as well as values larger than one are valid. Also
note that the first and third values only have relevance with the template
completion logic associated with the NUMENTER key. The second value is used
throughout the smart indenting logic.
****
Disclaimer for all BBS (and other distributed) utilities/programs/macros:
The programs and macros distributed on this diskette are available
strictly as aids and examples for users of Mansfield Software Group
products.
Mansfield Software does not guarantee, or commit to support or maintain
the programs or macros distributed on this diskette. Also note that the
programs and macros provided are not guaranteed to work with past,
present, or future versions of Mansfield Software products.
Nonetheless, comments and suggestions are welcome. Please post any
comments, suggestions, or bug reports in:
-- section 2 of the PCVENA forum on CompuServe, or
-- the Mansfield Software Group Bulletin Board, at (203) 429-3784.