xyzzy

KEX Macros

contents external
Introduction Contents Site map Contact
REXX links Details Directory Sources

top   Introduction

Kedit is a clone of XEDIT, the good old IBM mainframe editor, for DOS and OS/2 text mode (no GUI). The Windows versions KeditW are integrated into the Windows GUI, so some things are different. Almost all macros are tested with Kedit 5.00p4 for DOS and OS/2. Some macros should also work with KeditW 1.0 (but I didn't test it unless especially noted in the macro header). THE is another XEDIT clone for many systems (incl. Linux with Regina), and some macros might even work with THE or XEDIT. Please note that I never considered EBCDIC.

XEDIT, Kedit, and THE all use REXX as macro language. Kedit supports its own subset KEXX and some native REXX interpreters. Most of my macros are based on KEXX. If REXX is required there should be an info in the macro header. Some external tools are used, for DOS this is (optionally) setlines, for OS/2 you may need clipbrd.exe in clipbrd.kex, netscdde.exe (optionally) and netscape.exe in netscape.kex, some OS/2 system tools like mode.exe in mode.kex or setlines.kex, etc. as stated in the macro header.

All kml files are Kedit Macro Libraries, plain text like kex files. Let's hope that my server and your browser handle these files as plain text. If this doesn't work copy the files to your disk (try Shift Enter on the desired link).


top   Contents

Short descriptions of most macros are simply copied from khelp.kex. Entries marked by CP 858 use eight-bit characters (codepage 437 or 850). Entries marked by * (asterisk) are used explicitly as macro or synonym replacing a Kedit command.

A-X.kml        (example Kedit Macro Library redefining Alt-X)    2003
ANSIFY         translate ISO Latin 1 to Codepage 437 (or 850)    CP 858
BASE           Insert <base href="URL" /> in local XHTML copy    2006
BOX            draw BOXes (9 styles, use keypad or box block)
BROWSE         document browser (temporary wrap long lines)
BROWSE.cmd     (simple OS/2 REXX script using BROWSE.KEX)        2006
CDD            CHD + CHDR like 4DOS CDD supporting *.DIR items
CDEFG          show biggest files (top 1000) in DIR.DIR file
CHANGES        CHANGE all occurences on line, not only first
CHCP           Optionally set and get process codepage (OS/2)    2006
CLIPBRD        OS/2 WPS clipbrd.exe interface using GET & PUT
COLOR        * INITIAL.KEX calls COLOR by 'macro' monitor.1()    2006
COLOR2         Old (1995-2005) colour scheme for younger eyes
COUNTS         COUNT string in BLOCK / ALL lines ignoring CASE   2004
DOS.kml        INITIAL.KEX loads Kedit Macro Library DOS.KML
EIS            edit OEIS sequence in local EIS??.TXT copies      2003
ENV            like DOS SET, but modifying Kedit's environment   CP 858
EURO           check char.s not contained in ASCII 32..126 & 9
EXTRACT      * EXTRTEST clone, supports = and abbreviations
FEATURES       Kedit 5.00 (D3/P3) bug list and workarounds
FILES          Kedit FIDO FILES.BBS (add orphans to FILES.BBS)
GERMAN         defines GERMAN.KML after INITIAL.KML (KEYB GR)    CP 858
GERMAN.kml     (dito used Kedit Macro Library)                   CP 858
HEXA           hex. editor (like HEXE but using current MODE)
HEXE           hex. editor (show and maybe even patch binary)
HEXE.cmd       (simple OS/2 REXX script using HEXE.KEX)
HTM            edit *.htm or *.html in homepage directory        2003
HREF           convert URL (focus word) to dummy XHTML link
INITIAL      * PROFILE.KEX calls 'macro initial' if INITIAL()
INITIAL.kml    (dito used Kedit Macro Library)                   CP 858
KC             KCOMPARE clone (resetting special keys at exit)
KEX            Kedit macro using MACROPATH (or its definition)   CP 858
KEYCODES       Kedit key decoder (showing name and definition)
KEYDIFF        determine all reDEFINEd (non-default) keys
KHELP        * KHELP.KEX allows normal 'command khelp khelp'
KHELP.pro      (example KHELP.PROfile mentioned elsewhere)
KTAGS          XTAGS clone (supporting TABs and Unix tags)
LESSMORE       used as synonym for LESS TAG and MORE TAG error
LOCUS          locate target in any currently edited file
LONGEST        locate and tag longest line(s) in edited file
MBOXREF        replace In-Reply-To: by References: in mbox       2003
MODE           OS/2: 'DOSQ MODE x,y' plus 'PSCREEN y x PRESET'
MONO           INITIAL.KEX calls MONO  by 'macro' monitor.1()
MUSTARD        RFC 2119 keywords (MAY, MUST, SHOULD, etc.)       2006
NBSP           convert blanks in marked block to XHTML &#160;    2003
NETSCAPE       view focus URL with NETSCAPE or NETSCDDE.exe      2005
NMK            edit redirected output of NMAKE /f xyz.NMK xyz
OUTBOX.cmd     (OS/2 script: edit last Outbox message with XC)   2004
PROFILE      * KHELP.KEX allows normal 'command khelp profile'
QX             simplified XQ.KEX integrating RELOAD.KEX
REXX           edit OS/2 script or copy REXXTRAP.CMD stuff
REXXTRAP       update REXXTRAP.CMD functions in *.CMD scripts
RING         * DIR currently edited files TAGging modified
RW             force write access on edited read-only file
RXHELP         REXX context help (OS/2, MDOS, PC DOS 7, PREXX)   2005
RXLYNX         view focus URL or current file with RXLYNX.CMD
SETLINES       switch PSCREEN rows and columns
STATUS       * mini status: only relevant non-default settings
SUBJECT        encode CP 850 Subject: header as base-64 UTF-8
TIME         * show elapsed time for specified command
TRACE        * DEBUG manager (keys, debugging, RXTRACE, etc.)
TRASH          Netscape mailbox directory TREE (excl. *.snm)
TREE           corrected sample supporting long and HPFS id.s
TV             remove base64 TV (= MZ) binaries from mbox file   2003
UNBLANK        get rid of blank lines with even line numbers
UNESCAPE       experimental:  JavaScript decryption
UNIX           raw text mode based on EOLIN LF etc. settings     2004
UTF            hex. UTF-32 or UTF-16 to hex. UTF-8 and UTF-16    2006
WINDOWS        KeditW: could be called by  'macro' monitor.1()
X.cmd          (simple OS/2 REXX script: KEDIT command)
XC             edit file executing specified initial command
XC.cmd         (shell script: edit stdout & stderr of command)
XDIR           MANYFILE clone (corrected)
XDROP.cmd      (simple OS/2 REXX script: KEDIT drag & drop)
XEDIT.cmd      (simple OS/2 REXX script: KEDIT association)
XHTML          Convert plain text (code page 850) to XHTML 1.0   CP 858
XTREE          DIR all subdirecories TAGging empty directories
X-WIKI         Profile for text/x-wiki translates UTF-8 to NCR   2006
X-WIKI.cmd     (simple OS/2 REXX script using X-WIKI.KEX)        2006
XX             XEDIT file with name completion (DIR ambiguous)
XX.cmd         (simple OS/2 REXX script using XX.KEX)
ZIP            edit preselected files (e.g. here: ZIP manuals)

The following macros are contained in initial.kml CP 858 and also covered by khelp.kex:

COLORS         translate color setting to corresponding number
DAY            display date + weekday, any arg.: input as line
DOSX           edit redirected standard output of OS command
LASTMSG      * like QUERY LASTMSG, but in DIALOG (word wrap)
NAME           change filename and rename a corresponding file
NEMO           start an OS/2 Norton clone in directory of file
SAY          * display persistent result of REXX expression
WO             locate word in any edited file (uses LOCUS.kex)
XFN            xedit "=:=\fn.=" in the path of the actual file   2004
XFT            xedit "=:=\=.ft" in the path of the actual file   2004
XID            xedit "=:=\id"   in the path of the actual file   2004

top   Details

Sorry, I still hadn't the time to write more about this Kedit macro collection. Please tell me (contact) if you're using this stuff, so that I can add a more reasonable version management than "Check the timestamps in my kex source directory"... ;-)

For xhtml.kex see also the example (xhtml.kex applied on itself). There are already separate manuals for ktags.kex (contained in ktags.zip, 40 KB) and kc.kex (contained in kc.zip, 50 KB).

For more details about REXXTRAP.cmd see the separate REXXTRAP manual with short entries for REXX.kex and REXXTRAP.kex, i.e. Kedit macros REXX and REXXTRAP.

In features.kex I've collected many Kedit 5.0 features, bugs, and workarounds over the years. Some problems are apparently fixed in KeditW 1.0 and moved to the end of features.kex, but generally I didn't test KeditW.

If you have Kedit 5.0 get and install the last update P4 for OS/2 or D4 for DOS. In features.kex you'll find instructions how to patch the binaries of this version. The patches enable support for key 150 C-STAR, 55 A-STAR, and 114 S-STAR. The latter is the traditional name for AT-keyboard layouts with 84 keys, you have to press Ctrl+PrtSc on modern keyboards with 101 or more keys for S-STAR instead of Shift+Star. Probably Mansfield forgot these keys, because both the shifted and the unshifted Star of the numeric keypad simply result in *.

Another patch proposed in features.kex fixes a problem of the built-in KEXX-function delimit(). Under certain circumstances this function would use *, =, ?, or ~ as delimiter, but these characters don't work as delimiter for some kinds of locate-targets. The proposed patches work also with Kedit 5.0 P3 and Kedit 5.0 D3, but an upgrade to version P4 or D4 fails with manually patched binaries.


top   REXX links


XHTML validator Last update: 4 Nov 2007 18:00 by F.Ellermann