home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
myckeys.zip
/
README
< prev
Wrap
Text File
|
1994-03-11
|
9KB
|
275 lines
/* readme - this is the readme file of the MyCKeys package 940304 */
MyCKeys is an EPM editing mode for C code. It provides automatic
indentation, expansion and highlighting.
The following text describes how to install this EPM mode, and what
features it provides.
This package contains the following files:
[eas] -- extended attributes directory
myckeys.c -- C source sample
myckeys.e -- editing mode source
myckeys0.ex -- stand-alone compiled version (for ebookie users)
myckeys1.ex -- stand-alone compiled version
readme -- this file!
INSTALLATION:
=============
You can install MyCKeys in three ways. If you are not using ebookie,
the first method is for you (isn't that nice ? :-). The second method
is for ebookie users, but you will have to invoke a command whenever you
load a C source file(*). The third method will handle this automatically,
even for ebookie users, but you will have to recompile your editor macros.
(*) This is a Bad Thing(TM), but EPM does not allow an
externally-linked module to define a defload procedure. This
is my main grief against EPM. (Another grief is the lack of an
automatic parent-matching feature, à la EMACS... You can
simulate it, but it's way too slow, and quirky.)
'Quick' installation: (It does NOT work with ebookie)
---------------------
0. rebuild extended attributes for myckeys.c
eg: cd a: & eautil /j myckeys.c
[0bis. Optionally, rebuild myckeys.e extended attributes]
1. copy myckeys0.ex somewhere in your EPMPATH, and rename it
myckeys.ex
eg: copy a:myckeys0.ex c:\os2\apps\myckeys.ex
2. start EPM, and load myckeys.c
eg: start epm a:myckeys.c
[This step is important. It will define three styles (you can
redefine them, but don't change their names):
Case
Commentaire(*)
Function
(*) Well, I should have name it 'Comment', but it's too late,
now :-) ]
3. Link MyCKeys, by issuing the command 'link MyCKeys'
[You'll have to link myckeys each time you start an EPM
session. A good solution is to put the 'link MyCKeys'
command in your profile.erx file (you may have to activate
the profile support by issuing the 'profile on' command).]
[3bis. Enable syntax expansion, by issuing the 'expand on'
command, if you have previously disabled it.]
And here you are...
'Quick'n dirty' installation:
-----------------------------
0. rebuild extended attributes for myckeys.c
eg: cd a: & eautil /j myckeys.c
[0bis. Optionally, rebuild myckeys.e extended attributes]
1. copy myckeys1.ex somewhere in your EPMPATH, and rename it
myckeys.ex
eg: copy a:myckeys1.ex c:\os2\apps\myckeys.ex
2. start EPM, and load myckeys.c
eg: start epm a:myckeys.c
[This step is important. It will define three styles (you can
redefine them, but don't change their names):
Case
Commentaire(*)
Function
(*) Well, I should have name it 'Comment', but it's too late,
now :-) ]
3. Link MyCKeys, by issuing the command 'link MyCKeys'
[You'll have to link myckeys each time you start an EPM
session. A good solution is to put the 'link MyCKeys'
command in your profile.erx file (you may have to activate
the profile support by issuing the 'profile on' command).]
4. Whenever you load a C file, issue the 'MyCKeys' command.
[4bis. Enable syntax expansion, by issuing the 'expand on'
command, if you have previously disabled it.]
And here you are...
'Slow' installation:
--------------------
This installation is not properly speaking 'slow', but it's for
more experienced users. You'll have to recompile epm.ex and
extra.ex.
0. rebuild extended attributes for myckeys.c and myckeys.e
eg: cd a: & eautil /j myckeys.c & eautil /j myckeys.e
1. Go to your E macros directory
eg: d: & cd \src\epm551\embarks
2. rename ckeys.e ckeys.org, or whatever you want...
eg: ren ckeys.e ckeys.org
3. copy myckeys.e in this directory, and rename it ckeys.e
eg: copy a:myckeys.e ckeys.e
4. recompile epm.ex and extra.ex. Put those new files in your
EPMPATH
eg: etpm epm & etpm extra & copy *.ex c:\os2\apps
5. Start EPM, and load myckeys.c
eg: start epm a:myckeys.c
[This step is important. It will define three styles (you can
redefine them, but don't change their names):
Case
Commentaire(*)
Function
(*) See comment in 'Quick installation', step 2]
[5bis. Enable syntax expansion, by issuing the 'expand on'
command, if you have previously disabled it.]
6. Exit EPM
And that's all. MyCKeys mode will be automatically invoked
whenever you load a C file.
FEATURES:
=========
MyCKeys mode provides the following features for files whose
extension is one of '.c', '.h', '.ph', '.cpp', '.cxx' or '.sqc'
Automatic indentation:
----------------------
I like STREAM mode. But in this mode, standard EPM does not
provide auto indentation. MyCKeys provides it for STREAM mode.
In addition, there is a function you can assign to your favorite
key : indentline. If you want to assign it to the tab key, put the
following in your profile.erx:
'buildaccel *' 1 9 9300 indentline
activateaccel
Syntax expansion:
-----------------
MyCKeys mode provides the same C expansion as standard EPM.
(Well, I've customized it a bit, but you can override my changes
by making changes in the 'expansion control constants' part of
myckeys.e, and recompiling it...)
Involved statements:
if
for
do
while
switch
case
/* */
main
Highlighting:
-------------
I like code highlighting very much. But I don't like syntax
highlighting as done by, say, Borland IDE... I don't care having
all semi-colons showing in green. It's not important. Even
worse, it's distracting...
Instead, I would be pleased to see all functions headers in green
(or whatever color you like, as long as it's green :-), and things
like that. In fact, I want highlighting to carry a semantic
meaning, more than just a syntactic one...
So does MyCKeys. It's far from perfect, but it's better than
nothing... and it suits my needs, with acceptable constraints :-)
It highlights comments, case statements and functions headers. It
does on-the-fly highlighting, but it does not (yet) highlight
pre-existing code.
[The following heuristic is used to recognize a function header:
When you type an opening brace in column 1, and if the first word
of the previous line is not 'typedef', then the function header
starts at the first character of the nearest line whose first
character is in column 1, and ends just before the opening brace.
(endembed comments are preserved.)
The following heuristic is used to recognize a comment:
When you type '/*', followed by a space, a comment is recognized,
the comment closing sequence '*/' is typed in, and highlighting
is done.
And the following heuristic is used to recognize a case
statement:
When you press the Enter key on a line whose first word is
'case', then the whole line is highlighted.]
[Remember! You should have syntax expansion enabled in order to
use automatic highlighting (use the 'expand on' command)]
KNOWN BUGS/PROBLEMS:
====================
If a comment follows a case statements on the same line, and if
you press the Enter key on this very line, the comment will take
the case statement color. (except for the first case of a switch
statement :-)
FIX: go to the end of line, and press Ctrl-Enter
Comments are only recognized and highlighted when they are typed
at the end of the line.
FIX: none, but it may be fixed in a next version.
Whenever an EPM action issues a replacestring command,
highlighting on the involved lines will be lost.
FIX: this is an EPM problem. The replacestring command is not
attribute-aware...
And many others, but they're all features :-)
Any comments and suggestions welcome...
--
Martin Lafaix
lafaix@sophia.inria.fr