home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
mlepm.zip
/
mlepm.INF
(
.txt
)
< prev
next >
Wrap
OS/2 Help File
|
1995-09-19
|
50KB
|
1,755 lines
ΓòÉΓòÉΓòÉ 1. Preface ΓòÉΓòÉΓòÉ
(c) Martin Lafaix 1994, 1995.
This manual describes the features of MLEPM. It is intended for the user who
is new to MLEPM. However, it is not meant to be a tutorial; it is assumed
that the user has had some experience with EPM. The information on how to use
the package, therefore, is presented here in a reference or summary manner.
Tables and lists summarize key functions and commands. If you cannot find
what you are looking for, refer to the index for cross referencing.
MLEPM is a set of macros. Although a discussion of superficial tailoring is
presented herein, the macro language (the E language) which allows the EPM's
programmability is not discussed in this manual at all. For information on
the E language, users should refer to The EPM Editor Technical Reference.
Note: EPM will be used as an abbreviation for the Enhanced Editor throughout
this document.
ΓòÉΓòÉΓòÉ 1.1. Related Manuals ΓòÉΓòÉΓòÉ
The following manual contains information related to the E editor:
o The Enhanced Editor User's Guide
o The EPM Editor Technical Reference Manual
o Rexx Information in OS/2 2.0 Information
ΓòÉΓòÉΓòÉ 1.2. Special Notice ΓòÉΓòÉΓòÉ
The term OS/2 is a trademark of the IBM Corporation.
MLEPM is (c) Martin Lafaix 1994, 1995.
Author: Martin Lafaix
Address:
16, rue de Dijon
06000 Nice
France
email: lafaix@alto.unice.fr
ΓòÉΓòÉΓòÉ 2. Release Notes ΓòÉΓòÉΓòÉ
This is the fourth public release of MLEPM (v0.034.000).
It's a beta version.
It contains the following improvements since v0.033.000:
o mpopupmenu revisited (for EPM v5.60+);
o bug fix in MATCHKEY;
o An enhanced HTML mode (can be used with EBOOKIE);
o .userstring no longer used to store file language;
o On-the-fly highlighting was broken with EPM v5.51a.
v0.033.000 added the following:
o Full EPM 6 support;
o User-defined highlighting rules in C/C++ mode are now used;
o Autosave mode works again when editing files with on-the-fly highlighting
(see mautosave);
o A new mmarkarea function, used to select area bounded by delimiters
(strings, ...);
o In C/C++ mode, Alt+1 over a #include directive loads the corresponding file.
ΓòÉΓòÉΓòÉ 3. Getting Started ΓòÉΓòÉΓòÉ
The following sections describe the basics of MLEPM: prerequisites,
installation and FAQ.
ΓòÉΓòÉΓòÉ 3.1. Prerequisite ΓòÉΓòÉΓòÉ
The included .EX files have been compiled for EPM v5.51a and EPM v6.00c. EPM
v5.51a is the version included with Warp. If you have an earlier version of
EPM, you may have to recompile the macros with the corresponding ETPM compiler,
but I highly recommend you to grab EPM v5.51a from, say,
software.watson.ibm.com:/pub/os2/ews (do not use the one in /pub/os2/os2fixes,
it's an older version!).
If you have a newer version (such as v5.60 or v6), you may have to recompile
the macros with the corresponding ETPM compiler. It will allowed you to use
Extended GREP, and things like that. MLEPM has been tested with both EPM
v5.51a and EPM v6.00c. Please use the EPM v5.60+ specific profile file
(profile.600), as it is tailored for theses versions.
ΓòÉΓòÉΓòÉ 3.2. Installation ΓòÉΓòÉΓòÉ
1. Unpack this package.
2. Depending on you editor's version, either unpack ex.551 or ex.600 (or, if
you're using a different version, use the MAKEMACS.CMD script to rebuild
the macros for your editor -- ETPM is required for this step).
3. Copy all .ex files somewhere along your EPMPATH.
4. Put MPOPUP.EXE somewhere along your PATH. Start MPOPUP.EXE (and put a
Program Object referring to it in your startup folder)
5. Load epm and edit the styles.smp file. Customize the included styles (via
the "Style" dialog, Ctrl+Y), if needed.
[This step IS important!]
6. Enable the profile support, if not already done:
Bring up the "command" dialog (Ctrl+I), Enter the following command:
PROFILE ON. Save your options (Options/Save options)
7. Merge profile.551 or profile.600 with your profile.erx (if you were not
using a profile.erx, just rename profile.nnn to profile.erx, and put it
somewhere along your EPMPATH).
8. Exit EPM, and restart it. Try loading a new C file, and play with it...
That's all!
ΓòÉΓòÉΓòÉ 3.3. Common Q&A ΓòÉΓòÉΓòÉ
This section contains commonly asked questions on MLEPM.
What is MLEPM?
MLEPM provides hooks, popup menus, [auto]highlighting and "modes"
for EPM.
Why MLEPM?
Well, that's a good question. MLEPM is a set of macros I started to
develop more than two years ago. I did it to make EPM suits my
needs/preferences. Before using EPM, I was (and still am :-) used
to Emacs. But then, there was no correct implementation of Emacs
for OS/2. So, I decided to use EPM, and hence MLEPM...
Note: MLEPM does NOT try to emulate Emacs look and feel/behavior
Is MLEPM loaded?
Use the mversion function. If you get an error, well, MLEPM is not
loaded. Check in the message box (Option/Messages...): if it
contains "Link : file not found" messages, MLEPM's .EX files are
probably not somewhere along your EPMPATH.
If the message box contains "Link completed, module #...", are you
sure you're loading all required .EX?
If the message box does not contains one of the previous statement,
it look like you're not loading MLEPM. Is the profile support
enabled? And, if yes, does a profile.erx exists somewhere along your
EPMPATH? And, if yes, is there any incorrect profile.erx earlier in
the EPMPATH?
I'm loading an existing C file, and it's not highlighted!
MLEPM does not automatically highlights preexisting files. Use the
mhilite function (you just have to do that ONCE PER file).
It does not highlights my C/... file on the fly!
Is MPOPUP.EXE up and running? If yes (that is, there's a MLPOPUP
entry in the task list), is autohighlighting enabled? (Call the
mautohilite command -- if it says "AUTOHILITE : OFF", then enable
it.)
Loading an highlighted file is slower than before!
Yes, indeed. It takes a few seconds to rebuild highlightings from
Extended Attributes.
MLEPM does not highlight keywords, constants, ... in my files!
It does not do that by default, mainly because I don't like it :-)
Another thing to take in consideration: the more item you highlight,
the longer it will take to highlight/load/save your files. And, due
to an EPM limitation, attributes can't exceed 64KB when saved.
I edited one of my files with another editor, and it looks like highlighting
is out-of-synch for this file now...
Use the mrehilite function to re-synchonize highlighting.
I'm using EPM v5.60 or v6. Is MLEPM of any use for me?
Yes, absolutely, MLEPM works great with EPM v5.60+. Be sure to use
the specific profile file, profile.600.
When used with such a version, MLEPM brings you improved editing
modes, hooks, more powerful highlighting schemes (but it's
definitely slower than native EPM v6 highlighting), and much more.
There's a major difference in the way MLEPM and EPM v6 handle
highlighting. EPM v6 is great for highlighting keywords and
line-oriented files, and it is fast (less than 3 seconds to
highlight stdctrl.e). But it's not very powerful: multi-lines
comments are not highlighted, and you can only use keywords (or a
starting and an ending delimiter, if they are on the same line) --
you cannot use regular expressions. On the opposite, MLEPM is
slower (1 minute to highlight the same file -- but you just have to
do it once), but multi-lines comments are handled just fine, and all
functions definitions can be highlighted -- you can use regular
expressions (and even the 'extended' regular expressions, introduced
with EPM v5.60).
There's one feature of MLEPM which is completely superseded by EPM
v6 : Popup menus. They works fine, but EPM's implementation is
simply better.
ΓòÉΓòÉΓòÉ 4. Basic Packages ΓòÉΓòÉΓòÉ
MLEPM is composed of three main package, MLHOOK, MLHILITE and MLTOOLS. There's
a minor package, too: MATCHKEY.
ΓòÉΓòÉΓòÉ 4.1. MATCHKEY ΓòÉΓòÉΓòÉ
This package mimics the Emacs parent matching. Opening tokens ("(", "[" and
"{") insert the matching one, too.
By "mimics", I mean, when you press a closing token key, it will temporarily
highlight the matching token.
To use it, put MATCHKEY.EX somewhere along your EPMPATH, and insert the
following statement in your profile.erx (you can issue the command via the
"command" dialog (Ctrl+I), if you just want to try it):
link MATCHKEY
Don't use it if you don't like it! :-)
This package is totally independent. It's an adaptation of the original
MATCHKEY, included in the EPM package.
ΓòÉΓòÉΓòÉ 4.2. MLHILITE ΓòÉΓòÉΓòÉ
Preliminary notes
This package is designed to be used as an external module. Put MLHILITE.EX
somewhere along your EPMPATH, and insert the following statement in your
profile.erx (you can issue the command, if you just want to try it):
link MLHILITE
Autohighlighting requires MLHOOK to be loaded and MPOPUP.EXE to be up and
running.
This package provides functions which allows you highlight/unhighlight a whole
file, or only parts of it. It also allows you to specify rules used to
highlight a given language.
It provides the following functions:
o mautohilite
o mhilite
o mhiliteadd
o mhiliteclr
o mhilitedef
o mpackhilite
o mrehilite
o munhilite
o munhilitemark
And, it defines those two hook-functions:
o hilite_mode_hook
o hilite_modify_hook
ΓòÉΓòÉΓòÉ 4.3. MLHOOK ΓòÉΓòÉΓòÉ
Preliminary notes
This package is designed to be used as an external module. Put MLHOOK.EX
somewhere along your EPMPATH, and insert the following statement in your
profile.erx (you can issue the command, if you just want to try it):
link MLHOOK
This package provides hooks for main events; namely:
o fake_autosave
o load_hook
o modify_hook
o save_hook
o select_hook
And it defines the following functions, which allows you to use/define hooks:
o maddhook
o mautosave
o mcallhook
o minitializehook
o mrevcallhook
o msethook
o mversion
A hook is a place you can attach functions to. It's generally associated with
a specific event.
It allows you to do a special action whenever the event occurs. For example,
if you want to adapt the menu bar to the current file, you can add a function
on the select_hook hook.
ΓòÉΓòÉΓòÉ 4.4. MLTOOLS ΓòÉΓòÉΓòÉ
Preliminary notes
This package is designed to be used as an external module. Put MLTOOLS.EX
somewhere along your EPMPATH, and insert the following statement in your
profile.erx (you can issue the command, if you just want to try it):
link MLTOOLS
This package mainly works on attributed (aka highlighted) files, so it's
recommended that you use it with a highlighting-package (as MLHILITE). If you
want to use the mode hook, you have to link MLHOOK, too.
Popup menus require the MPOPUP.EXE program to be running.
It provides the following functions:
o mautoindent
o mdebug
o mfind
o mfindfunction
o mgo
o mindentline
o mloadattributes
o mmarkarea
o mnext
o mnextfunction
o mpopupmenu
o mquicksave
o msaveattributes
o msetfilemode
o msetstatusline
o newtop
And, it defines this hook-function:
o show_mode_hook
Popup Menus
The popup menu feature is version-dependant. If you are currently using EPM
v5.51a (or earlier), it is not easily customizable, but it nonetheless allows
you to use popup menus, and that's quite nice :-)
If you're using EPM v5.60 or higher, then, you can define mode-dependant
and/or smart popup menus. See mpopupmenu for more details.
If you're using EPM v5.51a, MLEPM defines five different popup menus:
1. The "char mark" popup;
2. The "non-char mark" popup;
3. The "outside mark" popup;
4. The "no mark" popup;
5. And the "EPM" popup.
The first popup is displayed when clicking inside a "char" mark. It contains
the following options:
Unmark Alt+U
Delete mark Alt+D
Fill mark
Reflow mark
Uppercase selection Ctrl+F3
Lowercase selection Ctrl+F4
Sort
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Copy Ctrl+Ins
Cut Shift+Del
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Style... Ctrl+Y
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Proof
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Print mark...
The second popup is displayed when clicking inside a "non-char" mark, that is,
a "block" or "line" mark. It contains the following options:
Unmark Alt+U
Delete mark Alt+D
Fill mark
Reflow mark
Uppercase selection Ctrl+F3
Lowercase selection Ctrl+F4
Sort
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Shift left 1 Ctrl+F7
Shift left 2
Shift left 3
Shift right 1 Ctrl+F8
Shift right 2
Shift right 3
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Copy Ctrl+Ins
Cut Shift+Del
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Style... Ctrl+Y
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Proof
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Print mark...
The third popup is displayed when clicking outside a mark. That is, a mark
exists, but you are "outside". It contains the following options:
Copy mark
Move mark Alt+M
Overlay mark
Adjust mark Alt+A
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Unmark Alt+U
This fourth popup is displayed when there's no mark in the current ring. It
contains the following options:
Mark word Alt+W
Mark identifier Ctrl+W
Find identifier
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Uppercase word Ctrl+F1
Lowercase word Ctrl+F2
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Center line Shift+F5
Scroll to top
The fifth (and last) popup is usually associated with the third mouse button
(if any), and contains the following "generic" options:
Paste Shift+Ins
~Import text file...
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
~Save F2
~Rename... F7
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
~Make
~Build all
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
~Print file...
Search... Ctrl+S
Note: The "Make" and "Build all" options are not yet completed.
If you want to modify these popup menus, you'll have to edit mpopup.rc, and to
rebuild MPOPUP's resources. If you want to add an option, you may have to
define a corresponding "accelerator", via the buildacceltable function.
(Please, do not use accelerators values in range 9200..9299, as they may by
used in upcoming versions of MLEPM.)
Highlighting-Related Functions
mfind, mfindfunction, mgo, mloadattributes, mnext, mnextfunction and
msaveattributes.
Miscellaneous
mautoindent, mdebug, mindentline, mquicksave, mmarkarea msetfilemode,
msetstatusline, newtop and show_mode_hook.
ΓòÉΓòÉΓòÉ 5. Editing Modes ΓòÉΓòÉΓòÉ
MLEPM includes many editing modes, and you can easily add your own.
o cmode
o emode
o htmlmode
o listmode
o pmode
o rcmode
o rexxmode
ΓòÉΓòÉΓòÉ 5.1. The C/C++ Mode ΓòÉΓòÉΓòÉ
This mode could be used while editing C or C++ files. It provides
autoindentation, autohighlighting, and autoexpansion. It defines the following
functions:
o C_mode
o c_load_hook
o mhilite_C_mark
o mcindentstyle
o indent_C_line
It redefines the following key:
o Alt+1
Turning autoexpansion off (EXPAND OFF) does not turn autohighlighting off, but
you'll lose the benefits of autoindentation. The standard EPM auto-expansion
may appears annoying at first, but you can now tailor it with mcindentstyle,
and it's easy to become 'addicted'...
By default, CMODE recognize the following extensions:
C H PH IH SQC CPP HPP CXX XH XPH XIH
If you want to use CMODE while editing a file with another extension, you can
use the C_mode function. It will switch the current editing mode to be CMODE.
The Alt+1 combination allows you to edit a file specified in a #include
directive:
#include "foo.h"
#include <os2.h>
Pressing Alt+1 on the first line will search foo.h in the current directory,
while pressing Alt+1 over the second will search os2.h along the INCLUDE
environment variable.
ΓòÉΓòÉΓòÉ 5.2. The E Mode ΓòÉΓòÉΓòÉ
This mode could be used while editing E files. It provides autoindentation and
autoexpansion. It defines the following functions:
o E_mode
o e_load_hook
o indent_E_line
This editing mode does not specifies specific highlighting hints. If you want
to use autohighlighting in E files, you'll have to use, for example, the
MLHILITE package.
Turning autoexpansion off (EXPAND OFF) does turn autoindentation off, too.
By default, EMODE recognize the 'E' extension only. If you want to use EMODE
while editing a file with another extension, you can use the E_mode function.
It will switch the current editing mode to be EMODE.
ΓòÉΓòÉΓòÉ 5.3. HTML Mode ΓòÉΓòÉΓòÉ
Not completed yet
This mode adds HTML-specific functions. It can be used in conjunction with
EBOOKIE (it's in fact recommended).
It provides the following functions:
o HTML_mode
o html_load_hook
o html_style
o html_tabify
o mpopup_HTML_menu
This mode defines a contextual menu, which allows easy access to its
functions.
By default, HTMLMODE recognize both 'HTM' and 'HTML' extensions. If you want
to use HTMLMODE while editing a file with another extension, you can use the
HTML_mode function. It will switch the current editing mode to be HTMLMODE.
There's currently only two function, html_style and html_tabify.
html_style is used to surround the current mark with a beginning an ending
delimiter, derived from its parameter. For example,
html_style STRONG
adds <STRONG> and </STRONG> around the current mark (or it simply inserts it
if there's no mark in the current file).
html_tabify converts a coma- and semicolon-delimited list into a HTML table.
For example, if you have:
title1, title2, title3;
item11, ,item13;
item21;
,item32
It will be translated in:
<table border>
<tr><td>title1</td> <td>title2</td> <td>title3</td></tr>
<tr><td>item11</td> <td></td> <td>item13</td></tr>
<tr><td>item21</td></tr>
<tr><td></td> <td>item32</td></tr>
</table>
[',' is the column delimiter and ';' is the row delimiter.]
ΓòÉΓòÉΓòÉ 5.4. The List Mode ΓòÉΓòÉΓòÉ
This mode could be used while browsing 'list' file (that is, files like
00index.txt...). It allows you to easily select one or more line. It can
compute the total required size, and things like that...
It redefines the following three keys:
Key Definition
Space Toggle the current line state (selected or not). It also updates
the status line.
U Unselect all lines. It also updates the status line.
L Popups a list containing all selected lines.
It defines the following two functions:
o List_mode
o list_load_hook
By default, LISTMODE recognize the 'LIST' and '00INDEX.TXT' extensions. If
you want to use the LISTMODE while editing a file with another extension, you
can use the List_mode function. It will switch editing mode to be LISTMODE.
LISTMODE modifies the status line to be:
Line %l of %s nnn Items selected [xxx bytes] List mode %m
This mode is not totally completed yet. Namely, the item count and size is
lost between sessions. And, the size is the sum of the first number in all
selected lines. It would be great to allow it to be customizable.
ΓòÉΓòÉΓòÉ 5.5. The Pascal Mode ΓòÉΓòÉΓòÉ
This mode could be used while editing Pascal files. It provides
autoindentation and autoexpansion. It defines the following functions:
o Pascal_mode
o p_load_hook
This editing mode does not specifies specific highlighting hints. If you want
to use autohighlighting in Pascal files, you'll have to use, for example, the
MLHILITE package.
Turning autoexpansion off (EXPAND OFF) does turn autoindentation off, too.
By default, PMODE recognize the 'PAS' and 'PASCAL' extension only. If you want
to use PMODE while editing a file with another extension, you can use the
Pascal_mode function. It will switch the current editing mode to be PMODE.
ΓòÉΓòÉΓòÉ 5.6. The RC Mode ΓòÉΓòÉΓòÉ
This mode could be used while editing RC (i.e., resource script) file. It
provides autoindentation, autoexpansion and optionally auto-capitalization of
keywords. It defines the following functions:
o RC_mode
o rc_load_hook
o indent_RC_line
This editing mode does not specifies specific highlighting hints. If you want
to use autohighlighting in resources files, you'll have to use, for example,
the MLHILITE package.
Turning autoexpansion off (EXPAND OFF) does turn autoindentation off, too.
By default, RCMODE recognize the 'RC' and 'DLG' extension only. If you want
to use RCMODE while editing a file with another extension, you can use the
RC_mode function. It will switch the current editing mode to be RCMODE.
ΓòÉΓòÉΓòÉ 5.7. The REXX Mode ΓòÉΓòÉΓòÉ
This mode could be used while editing REXX scripts (i.e., command files). It
provides autoindentation and autoexpansion. It defines the following functions:
o REXX_mode
o rexx_load_hook
o indent_REXX_line
This editing mode does not specify specific highlighting hints. If you want to
use autohighlighting in resources files, you'll have to use, for example, the
MLHILITE package.
Turning autoexpansion off (EXPAND OFF) does turn autoindentation off, too.
By default, REXXMODE recognize the following extensions:
BAT CMD EXC EXEC ERX XEDIT
If you want to use REXXMODE while editing a file with another extension, you
can use the REXX_mode function. It will switch the current editing mode to be
REXXMODE.
ΓòÉΓòÉΓòÉ 6. MLEPM Commands ΓòÉΓòÉΓòÉ
All functions names are prefixed with an "m", in order to prevent name-clash
with future (possible) EPM functions. (We can't expect them to share the same
definition, can we? :-)
Whenever a function has the string "hilite" in it, this string can be replaced
with "highlight". And if a part of a function name is enclosed in
square-brackets, this part is optional. So, the function
mhilite[file]
stands for
mhilite, mhighlight, mhilitefile and mhighlightfile
MLEPM adds the following commands:
fake_autosave
hilite_load_hook
hilite_modify_hook
load_hook
maddhook
mautohilite
mautoindent
mautosave
mcallhook
mcindentstyle
mdebug
mfind
mfindfunction
mgo
mhilite[file]
mhiliteadd
mhiliteclr
mhilitedef
mindentline
minitializehook
mloadattributes
mmarkarea
mnext
mnextfunction
modify_hook
mpackhilite
mpopupmenu
mquicksave
mrehilite[file]
mrevcallhook
msaveattributes
msetfilemode
msethook
msetstatusline
munhilite[file]
munhilitemark
mversion
nextop
save_hook
select_hook
show_mode_hook
ΓòÉΓòÉΓòÉ 6.1. fake_autosave ΓòÉΓòÉΓòÉ
Syntax
fake_autosave
This hook is used to replace EPM default autosave feature. You have to use it
if you want to use on-the-fly highlighting with EPM v5.60+ (with EPM v5.51a,
you only have to use it if you want autosave with autohighlighting).
maddhook 'modify_hook 'fake_autosave
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.2. hilite_load_hook ΓòÉΓòÉΓòÉ
Syntax
hilite_load_hook
This hook is used to find out a file's language. Add this hook on load_hook:
maddhook load_hook hilite_load_hook
Package: MLHILITE
ΓòÉΓòÉΓòÉ 6.3. hilite_modify_hook ΓòÉΓòÉΓòÉ
Syntax
hilite_modify_hook
This hook enables autohighlighting. Add this hook on modify_hook:
maddhook modify_hook hilite_modify_hook
Package: MLHILITE
ΓòÉΓòÉΓòÉ 6.4. load_hook ΓòÉΓòÉΓòÉ
Syntax
load_hook
This hook is called whenever a new file is loaded (or renamed).
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.5. maddhook ΓòÉΓòÉΓòÉ
Syntax
maddhook hook function
This function adds the function function to the hook function list. Be
careful, hooks are case-sensitive.
Example:
maddhook load_hook default_load
This example adds the default_load function to the load_hook function list.
The default_load function will be called whenever the load_hook will be called
(that is, whenever a file is loaded or named).
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.6. mautohilite ΓòÉΓòÉΓòÉ
Syntax
mautohilite
This command actives or deactivates autohighlighting. The following parameters
are allowed: on, off, 0, 1 or nothing.
Examples:
mautohilite
mautohilite on
The first example shows the current state. The second sets autohighlighting
mode on.
Package: MLHILITE
ΓòÉΓòÉΓòÉ 6.7. mautoindent ΓòÉΓòÉΓòÉ
Syntax
mautoindent [|on|off]
This command sets the indentation mode (on by default). If no parameters are
given, it shows the current indentation state. Autoindentation is
mode-dependant.
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.8. mautosave ΓòÉΓòÉΓòÉ
Syntax
mautosave [#### | ON | OFF | ? | DIR]
Use MAUTOSAVE to display or set the autosave values. The parameters are:
[none] Displays the current values on the message line, and places an
MAUTOSAVE command in the command window where you can change it.
#### Sets the current autosave count to the specified number.
ON Sets the current autosave count to the default value.
OFF Sets the current autosave count to 0, turning off autosaves.
? Displays the current values in a window, with a button you can
select to list all files in the autosave directory.
DIR Lists all files in the autosave directory.
The autosave values displayed are the autosave count (after this many changes
are made to the file, an automatic save is done to a temporary file) and the
autosave file name (the file which is saved whenever the autosave count is
reached). The default autosave count is set through the Configure window.
The autosave path is also set in the Configure window; the autosave file name
is constructed from the autosave path, the current file name, and a unique
3-digit extension.
You must issue this command from the Command window.
Note: Use this function in place of EPM's autosave when dealing with
automatically highlighted files.
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.9. mcallhook ΓòÉΓòÉΓòÉ
Syntax
mcallhook hook
This function calls every functions of the hook function list, in the
first-inserted, first-executed order. You can use this function with your own
hooks. This function is used for "entry" hooks.
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.10. mcindentstyle ΓòÉΓòÉΓòÉ
Syntax
mcindentstyle n
This command modifies the C-code indentation style. Three styles are actually
recognized (-1 is the default):
1 int dummy(int a) 3 int dummy(int a)
{ {
int b; int b;
if(a) if(a)
{ {
b=a; b=a;
} }
else else
b=a+1; b=a+1;
} }
2 int dummy(int a)
{
int b;
if(a) {
b=a;
}
else
b=a+1;
}
If n is negative, braces will not be automatically added.
Example:
mcindentstyle 2
The second indent style will be used (it does not "reflow" the previously
entered code.)
Package: CMODE
ΓòÉΓòÉΓòÉ 6.11. mdebug ΓòÉΓòÉΓòÉ
Syntax
mdebug
This function puts all MLEPM-related debug information in a temporary file
(.mlepm).
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.12. mfind ΓòÉΓòÉΓòÉ
Syntax
mfind start_fid dest_fid style
This function copies the first line of items of style style , from start_fid to
dest_fid.
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.13. mfindfunction ΓòÉΓòÉΓòÉ
Syntax
mfindfunction
This function pops up a listbox containing all functions defined in current
file, with option to jump to a specific function. A function is something
which has the "Function" style. If a function spans on more than one line,
only the first line is shown in the listbox.
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.14. mgo ΓòÉΓòÉΓòÉ
Syntax
mgo style string
This function locates the specified string with the given style in current
file. If the string is found, the cursor is moved. Otherwise, nothing occurs.
string should be the beginning of the desired style. mgo finds the first
matching string.
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.15. mhilite[file] ΓòÉΓòÉΓòÉ
Syntax
mhilite[file]
This command highlights the current file. If the file's language has a
specific highlight function, this function is used. Otherwise, language's
rules are used. A specific highlight function is a function whose name follows
the format:
'mhilite_'language'_mark'
Note: The CMode package defines such a function, mlhilite_C_mark.
Package: MLHILITE
ΓòÉΓòÉΓòÉ 6.16. mhiliteadd ΓòÉΓòÉΓòÉ
Syntax
mhiliteadd language level style expr
This command defines a new language rule. If language has not be previously
defined, an error occurs. level is an integer (in range 1..4) which defines
the "priority" of the rule. Level 1 is the highest priority. (See example
below for more explanations on levels.) style is any style defined in the
"Style..." dialog box (reachable via the Edit menu). Specifying an unknown
style name is not an error -- but no style will be assigned to the matching
expressions in files. (Styles ARE case-sensitive.) expr is a string which
specifies the matching expressions. Its format is:
<delim>expr1<delim>[expr2<delim>]
where <delim> is any character, and expr1 a regular expression. (If present,
expr2 is a regexp, too.) A matching expression is defined by expr1, or, if
expr2 is present, included between expr1 and expr2.
Examples:
mhiliteadd REXX 1 Commentaire _/\*_\*/_
mhiliteadd REXX 4 Function ~^[a-zA-Z_][a-zA-Z0-9_]*:~
The first line defines a rule which matches a REXX comment. The language is
REXX, the level is 1, the style name is "Commentaire", and the expression is
composed of a "_" delimiter, a first expression, "/\*" and a second one, "\*/".
The first expression matches the REXX opening comment, and the second matches
the closing comment token. Note the "\" character in front of "*", as both
expressions are regular expressions.
The second line defines a REXX label, that is, something which starts on column
1, composed of letters, digits or underscores, and immediately followed by ":".
Note that the REXX label rule level is 4, too. This means that, if a text
matching the rule (A) is found inside a region of text which has already been
matched by a rule (B) of a higher level, the rule (A) will not be applied on
this matching occurrence. While I realize it's not that clear :), let me try
an example. Suppose we have the following REXX fragment:
/* bla bla bla
foo: ggffggf
bar: 940401
*/
baz:
The first rule matches the comment ("/* bla ... */"), and the second matches
"baz:". It does not match "foo:" nor "bar:", as theses two expressions are in
a region of text which as been recognized by our first rule (of a higher
level).
So, here is the golden rule on levels:
"A rule of a level l does not apply to an expression if this expression is
enclosed in an expression matched by a rule of a level m <= l."
Note the "<="; It means that the rules' order is important in a given level.
Rules are tried in a first-defined/first-tried order.
Package: MLHILITE
ΓòÉΓòÉΓòÉ 6.17. mhiliteclr ΓòÉΓòÉΓòÉ
Syntax
mhiliteclr language [level]
This command erases rules defined for a specified language. If language has
not been previously defined, an error occurs. If level is given, only rules of
level level will be removed; otherwise, ALL rules will be removed.
Example:
mhiliteclr REXX 4
It will remove the "REXX label" rule (assuming we were using the previously
defined samples statements.)
Package: MLHILITE
ΓòÉΓòÉΓòÉ 6.18. mhilitedef ΓòÉΓòÉΓòÉ
Syntax
mhilitedef language extensions
This command defines a new language, or redefines an existing one. A file whose
extension matches one in extensions will be handled with the rules defined for
language. If an extension is part of more than one language, the last defined
language will win the race. Extensions are case-insensitive.
Example:
mhilitedef REXX CMD ERX
It defines the REXX language. Files ending with ".cmd" or ".erx" will be
recognized as "REXX" files.
Package: MLHILITE
ΓòÉΓòÉΓòÉ 6.19. mindentline ΓòÉΓòÉΓòÉ
Syntax
mindentline
This function indents the current line. It's mode dependant. It can be
assigned to a key; put the following in your profile if you want to assign it
to the tab key:
buildaccel '*' 0 9 1236 mindentline
activateaccel
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.20. minitializehook ΓòÉΓòÉΓòÉ
Syntax
minitializehook
This function forces the load_hook to be executed. It's required by the silly
EPM profile.erx handling, as, when calling epm, command-line specified files
are loaded before profile.erx is executed.
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.21. mloadattributes ΓòÉΓòÉΓòÉ
Syntax
mloadattributes [Not yet completed]
This function loads current file attributes from its EAs. It supports the new
(compact) attribute format. It can read attributes from an old EPM file,
though...
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.22. mmarkarea ΓòÉΓòÉΓòÉ
Syntax
mmarkarea [mouse]
This function marks the current area/token. If mouse is 1, then it uses
current mouse position. Otherwise, it uses current cursor position.
If the current position is over a "balanceable" symbol, then the so delimited
area is marked. A balanceable symbol is one of:
()[]{}'"
Otherwise, it acts like marktoken.
Note: This function is bound to Ctrl+W by default.
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.23. mnext ΓòÉΓòÉΓòÉ
Syntax
mnext style [P]
This function locates the next (or previous, if P is specified) item of style
style. If such an item is found, the cursor is moved. Otherwise, nothing
occurs.
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.24. mnextfunction ΓòÉΓòÉΓòÉ
Syntax
mnextfunction [P]
This function locates the next (or previous, if P is specified) function
header. If such a function is found, the cursor is moved. Otherwise, nothing
occurs. This function can be assigned to a key, allowing you quick movements
in your files. Put the following in your profile.erx if you want to assign
"mnextfunction P" to Alt+up_arrow and "mnextfunction" to Alt+down_arrow:
buildaccel '*' 34 24 1234 mnextfunction
buildaccel '*' 34 22 1235 mnextfunction P
activateaccel
[34 stands for AF_VIRTUALKEY+AF_ALT, 24 is the down_arrow keycode, and 22 is
the up_arrow keycode. 1234 and 1235 can be any numbers, but they have to be
unique.
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.25. modify_hook ΓòÉΓòÉΓòÉ
Syntax
modify_hook
This hook is called whenever a file is modified.
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.26. mpackhilite ΓòÉΓòÉΓòÉ
Syntax
mpackhilite [Not yet completed]
This command packs highlight-attributes, in order to save space and time while
saving attributes.
Package: MLHILITE
ΓòÉΓòÉΓòÉ 6.27. mpopupmenu ΓòÉΓòÉΓòÉ
Syntax
mpopupmenu [menu]
Due to a bug in EPM v6.00c, you cannot assign a user-defined action to MB2. In
fact, if you do a single clic with mouse button 2, EPM's default popup menu is
always displayed. If you want the user-defined action to take place, use a
modifier (like Shift, Ctrl or Alt) or press the button a bit longer. (This may
have been corrected in newer version, I don't know.)
This function popups a menu. The popped up menu depends on the cursor location
and the current editing mode.
If the current editing mode defines a
'mpopup_'language'_menu'
function, then it is called and the corresponding popup menu is displayed. If
no such function has been defined, a default menu is used (who actually depends
on the cursor position and selection state).
Depending on your EPM version, the definition of mode dependant menu varies:
o If you're using EPM v5.51a (or earlier), you'll have to edit mpopup.rc, add
a new popup menu and rebuild MPOPUP's resources. If you want to add an
option, you may have to define a corresponding "accelerator", via the
buildacceltable function. (Please, do not use accelerators values in range
9200..9299, as they may by used in upcoming versions of MLEPM.)
The function must then call the mpopup function, with the menu ID as its
unique parameter. For example:
defc mpopup_C_menu
compile if EVERSION < 5.60
'MH_gotoposition'
call mpopup(1234)
compile else
-- ...
compile endif
o If you're using EPM v5.60 (or higher), then simply define a popup menu and
show it:
defc mpopup_C_menu
compile if EVERSION < 5.60
-- ...
compile else
universal activemenu, previouslyactivemenu
if previouslyactivemenu = '' then
previouslyactivemenu = activemenu
endif
menuname = 'popup1'
activemenu = menuname
deletemenu menuname, 0, 0, 0
buildsubmenu menuname, 80, '', '', 0 , 0
'MH_gotoposition'
ch = substr(textline(.line), .col, 1)
gray_if_space = 16384*(ch=' ')
buildmenuitem menuname, 80, 8000, 'Mark word'\9'Alt+W', 'MARKWORD', 0, mpfrom2short(HP_POPUP_MARKWORD, gray_if_space)
buildmenuitem menuname, 80, 8001, 'Mark token'\9'CtrL+W', 'MARKTOKEN', 0, mpfrom2short(HP_POPUP_MARKTOKEN, gray_if_space)
showmenu menuname,1
compile endif
If the menu parameter is used, it is passed to the mode-dependant function.
It allows you to use 3-buttons mouse, for example, with different menus for
each button.
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.28. mquicksave ΓòÉΓòÉΓòÉ
Syntax
mquicksave [|on|off]
This command sets the quicksave mode (on by default). When in quicksave mode,
using the F2 key saves the file, but not its attributes.
This is much faster than the standard save, so it can be use for intermediate
saves (say, before compiling...).
Note: It does NOT reset the .modify counter -- this gives you the opportunity
to save the file with its attributes later.
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.29. mrehilite[file] ΓòÉΓòÉΓòÉ
Syntax
mrehilite[file]
This command first unhighlights the file, and then rehighlights it. It's just
the same as issuing munhilite followed by mhilite.
Package: MLHILITE
ΓòÉΓòÉΓòÉ 6.30. mrevcallhook ΓòÉΓòÉΓòÉ
Syntax
mrevcallhook hook
This function calls every functions of the hook function list, in the
last-inserted, first-executed order. You can use this function with your own
hooks. This function is used for "exit" hooks.
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.31. msaveattributes ΓòÉΓòÉΓòÉ
Syntax
msaveattributes [Not yet completed]
This function save the current file attributes in its EAs. They are saved in
the new (compact) attribute format.
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.32. msetfilemode ΓòÉΓòÉΓòÉ
Syntax
msetfilemode filemode
This function sets the current file mode. It can be any string (but a short
one is recommended, though...). The filemode will be shown on the statusline
if this statusline contains "%t".
Example:
msetfilemode 'C++ mode'
The current file mode will now be "C++ mode". This string will appears in the
statusline if it contains "%t". (The show_mode_hook has to be in effect.)
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.33. msethook ΓòÉΓòÉΓòÉ
Syntax
msethook hook function
This function clears the hook function list, and sets function as the only
member of the hook function list. Use this function with great care.
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.34. msetstatusline ΓòÉΓòÉΓòÉ
Syntax
msetstatusline newstatusline
This function replaces the old setstatusline. Same usage, same effects (it
just remembers the actual statusline value).
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.35. munhilite[file] ΓòÉΓòÉΓòÉ
Syntax
munhilite[file]
This command unhighlights the current file. That is, all attributes are
removed from the file.
Note: It removes bookmarks, too.
Package: MLHILITE
ΓòÉΓòÉΓòÉ 6.36. munhilitemark ΓòÉΓòÉΓòÉ
Syntax
munhilitemark
This command unhighlights the current mark. That is, all attributes are
removed from the mark.
Package: MLHILITE
ΓòÉΓòÉΓòÉ 6.37. mversion ΓòÉΓòÉΓòÉ
Syntax
mversion
This command displays current MLEPM version.
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.38. nextop ΓòÉΓòÉΓòÉ
Syntax
newtop
This function makes the current line the top-line. It's used by a popupmenu
option (Scroll to top).
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 6.39. save_hook ΓòÉΓòÉΓòÉ
Syntax
save_hook [not yet implemented]
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.40. select_hook ΓòÉΓòÉΓòÉ
Syntax
select_hook
This hook is called whenever a file is selected (that is, when a file becomes
active).
Package: MLHOOK
ΓòÉΓòÉΓòÉ 6.41. show_mode_hook ΓòÉΓòÉΓòÉ
Syntax
show_mode_hook
This hook is used to display the file mode in the statusline. If you want to
have the current file mode displayed in the status line, put the following in
your profile.erx:
maddhook 'select_hook 'show_mode_hook
and define a new statusline, which contains '%t':
msetstatusline 'Line %l of %s Column %c %f %i %m %t'
If no file mode is defined, 'Text mode' will appear.
[Using hooks requires a hook-package, eg MLHOOK, to be linked.]
Package: MLTOOLS
ΓòÉΓòÉΓòÉ 7. Changing the Default Configuration ΓòÉΓòÉΓòÉ
[Not yet completed...]
If you want to change the default configuration, the first place to look at is
your profile.erx file. In it, you can [re]define many things, including all
highlighting rules, key bindings, etc. In fact, all functions described herein
can be called from your profile.
If you want to change some settings for a specific file (like the default tab
width or margins, you can use the standard ADD_EA function to specify EPM.TABS
and EPM.MARGINS values).
But it's true you cannot always customize an editing mode the way you like
(say, if you want a different indentation scheme, or ...). To do that, you have
to edit the corresponding editing mode.
ΓòÉΓòÉΓòÉ 8. Creating New Editing Modes ΓòÉΓòÉΓòÉ
[Not yet completed...]
Editing modes are .EX files, loaded from profile.erx, so you have to have a
minimum E knowledge, and, most importantly, an E compiler (ETPM).
The easiest way to create a new editing mode is to copy and adapt an already
existing editing mode (be lazy :-).
MLEPM includes some editing modes, for mainstream languages:
emode.e
pmode.e
rcmode.e
rexxmode.e
cmode.e
listmode.e
The first four modes are very simple to understand. The fifth, CMODE, is more
complex, as it defines an "highlighting hint", to help the highlighting process
(it is used to highlight function headers, which are hard to find with regular
expressions). The last mode, LISTMODE, is somewhat different, in that it's not
really an editing mode -- it's here to gives you ideas of what can be done.
Editing modes basics
The first question is "What's that, and what can be done?". The answer is that
it's generally a key map and possibly a set of functions. It can do many
things, but it most commonly provides syntax expansion and automatic
indentation. It can also be used to define mode-dependant menus, or ...
...
ΓòÉΓòÉΓòÉ 9. Key Definitions Summary ΓòÉΓòÉΓòÉ
MLEPM does not redefines many keys. Anyway, here are the "Standard" keys
[re]defined by MLTOOLS, profile.erx, C_Mode and MATCHKEY, respectively:
Key Definition
F2 mquicksave
This key allows you to quickly save a file, if mquicksave
is enabled. If not, the usual behavior occurs.
Ctrl+W mmarkarea
This key allows you to quickly mark a delimited
token/area.
Alt+UpArrow mnextfunction P
This key allows you to go to the previous function header.
If such a header does not exists, nothing occurs.
Alt+DownArrow mnextfunction
This key allows you to go to the next function header. If
such a header does not exists, nothing occurs.
Alt+1 This key allows you to edit the file named on current
line. When editing a C/C++ file, it understands the
"#include" directive. That is, if the current line is
"#include <os2.h>" it will search os.h along the INCLUDE
path, and if the current line is "#include "os2.h"", os2.h
will be searched in the current directory.
( "()"
[ "[]"
{ "{}"
This key is also redefined by CMODE.
), ], } These keys temporarily highlight the corresponding
matching token. If the matching token is out of display,
the containing line will be shown in the message area.
And, if there's no matching token, "Matching token not
found" is displayed instead.
ΓòÉΓòÉΓòÉ 10. A Sample PROFILE.ERX ΓòÉΓòÉΓòÉ
This section describes a sample PROFILE.ERX. Each section of the file is
followed by an explanation. (Refer to your version-dependant version,
PROFILE.551 or PROFILE.600, for version-specific hints.)
/* profile.erx 950918 */
/* */
/* This file is executed whenever you start EPM */
/* defining useful constants */
MYPATH = ''
MYACCEL = 9300
If, for any reason, you don't want to put MLEPM's .EX files somewhere along
your EPMPATH, you can set MYPATH to the directory they reside in (don't forget
the ending backslash, as in "d:\src\epm\emacros\").
MYACCEL is used below, when defining accelerators. 9300 is a good value, as it
does not interfere with EPM's predefined values.
/* Linking additional EPM modules */
link MYPATH'MATCHKEY'
link MYPATH'MLHOOK'
link MYPATH'MLTOOLS'
link MYPATH'MLHILITE'
link MYPATH'CMODE'
link MYPATH'EMODE'
link MYPATH'REXXMODE'
link MYPATH'RCMODE'
/* link MYPATH'PMODE' -- commented out as I don't use Pascal... */
link bkeys
In the previous section, we link all needed files. If you don't need a
specific mode, just comment-out or remove the corresponding line. bkeys is
EBOOKIE, a great editing mode for "tagged" files (such as IPF). It's available
from software.watson.ibm.com in /pub/os2/epm/EBOOKE.ZIP.
We don't have to link standard .EX (such as EPM.EX and EXTRA.EX); they're
already loaded.
/* C/C++ and highlighting Mode hook */
msethook 'modify_hook 'hilite_modify_hook
maddhook 'load_hook 'hilite_load_hook
maddhook 'load_hook 'c_load_hook
maddhook 'load_hook 'e_load_hook
maddhook 'load_hook 'rexx_load_hook
maddhook 'load_hook 'rc_load_hook
The first hook enables on-the-fly highlighting (remember, MLPOPUP should be
running for this to work). The second hook enables generic mode recognition.
The next four hooks enable specific mode recognition.
/* I like mode in status line (here ) */
msetstatusline 'Line %l of %s Column %c %f %i %t %m'
maddhook 'select_hook 'show_mode_hook
This section redefines the status line, and add mode name in it. You have to
redefines the status line with the msetstatusline function if you want to
display the mode name. Do not use the setstatusline function.
/* Defining global keys */
buildaccel '*' 34 24 MYACCEL+1 mnextfunction
buildaccel '*' 34 22 MYACCEL+2 mnextfunction P
buildaccel '*' 34 23 MYACCEL-1 ml_hilite_line
activateaccel
The first two lines define nice shortcut keys (namely, Alt+UpArrow and
Alt+DownArrow, which allows you to go to the preceding and following function,
respectively).
The third line is required if you want to use on-the-fly highlighting. If you
have redefined MYACCEL in the first section of this PROFILE, use 9299 instead
of MYACCEL-1. If you use another value, on-the-fly highlighting will NOT work.
/* Adding a 'Headers...' item in the Search menu for mfindfunction */
buildmenuitem 'default 3 2997 \0 4 0 mfindfunction'
buildmenuitem 'default 3 2998 Headings... 0 0 mfindfunction'
showmenu default
The first line adds a separator at the end of the "Search" menu. The second
line adds a "Headings..." item next to it. This item is associated with the
mfindfunction function. The last line activates the newly defined menu.
/* Defining mouse bindings (popup menus) */
register_mouse 1 2 CLICK 0 mpopupmenu 0
register_mouse 1 3 CLICK 0 mpopupmenu 10
The first line defines the MB2 popup menu. If you don't have a 3-key mouse,
remove the second line, or change it so that it will assign the MB3 popup menu
to, say, Shift+MB2, or whatever you like. (To do that, change the value which
follows CLICK: it is 0 for no Shift, or the sum of any combination of 1 for the
Shift key, 2 for the Ctrl key, and 4 for the Alt key.)
/* Highlighting schemes */
The following sections define highlighted sequences. Feel free to tailor them,
but keep in mind that more than five regexps can induce a long highlighting
time...
[Please note that the following examples are for EPM v5.51a only. EPM v5.60 and
higher use extended regular expressions, so you have to backslash parents,
etc.]
/* C, C++ */
mhilitedef C 'C H PH IH SQC CPP HPP CXX XH XPH XIH'
mhiliteadd C 1 'Commentaire' '_/\*_\*/_'
mhiliteadd C 1 'Commentaire' '_//.*_'
mhiliteadd C 4 'Case' '_^[ \t]*case .*_'
mhiliteadd C 4 'Directive' '_#[ \t]*[^d].*_'
/* Standard ML */
mhilitedef ML 'SML'
mhiliteadd ML 1 'Commentaire' '_(\*_\*)_'
/* E macros */
mhilitedef E 'E'
mhiliteadd E 1 'Commentaire' '_/\*_\*/_'
mhiliteadd E 1 'Commentaire' '_--.*_'
mhiliteadd E 1 'Commentaire' '_^;.*_'
mhiliteadd E 4 'Function' '_^def.*_'
mhiliteadd E 4 'Directive' '_^[ \t]*compile.*_'
/* Rexx macros */
mhilitedef REXX 'CMD ERX'
mhiliteadd REXX 1 'Commentaire' '_/\*_\*/_'
mhiliteadd REXX 4 'Case' '_when.*then_'
mhiliteadd REXX 4 'Function' '~^[a-zA-Z_][a-zA-Z0-9_]*:~'
/* Scheme */
mhilitedef SCHEME 'SCM'
mhiliteadd SCHEME 1 'Commentaire' '_;.*_'
mhiliteadd SCHEME 4 'Function' '_(define (.*_'
/* IDL (SOM, ...) */
mhilitedef OIDL 'IDL CSC SC PSC CS2'
mhiliteadd OIDL 1 'Commentaire' '_/\*_\*/_'
mhiliteadd OIDL 1 'Commentaire' '_//.*_'
mhiliteadd OIDL 1 'Commentaire' '_--.*_'
mhiliteadd OIDL 1 'Commentaire' '_# .*_'
mhiliteadd OIDL 4 'Case' '~^[a-zA-Z].*:~'
/* DOS (SYS BAT) */
mhilitedef DOS 'SYS BAT'
mhiliteadd DOS 1 'Commentaire' '_^REM.*_'
/* IPF (IPF, IPP) */
mhilitedef IPF 'IPF IPP'
mhiliteadd IPF 1 'Commentaire' '_^\.\*.*_'
mhiliteadd IPF 4 'Function' '_^:h[0-3].*_'
/* Take ride of the silly (imho) EPM profile handling */
minitializehook
'sayerror Profile processed'
The minitializehook statement is REQUIRED. I mean it! Do not remove it, or
else MLEPM would not recognize pre-loaded files.