home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 21
/
CD_ASCQ_21_040595.iso
/
dos
/
prg
/
c
/
freedos3
/
source
/
ters151f
/
terse.doc
< prev
next >
Wrap
Text File
|
1994-02-08
|
39KB
|
894 lines
"You can never be too rich, too thin, or
have too much RAM and Disk storage."
Ancient American proverb, ca. 1980
(As quoted by the QEDIT manual.)
/--------------------\
| TERSE Version 1.5 |
\--------------------/
Tiny ``BRIEF''-like editor by
Joseph (Yossi) Gil.
TERSE is a tiny (only 4096 bytes) but amazingly powerful full-screen
editor for files of up to 64K in length. TERSE runs on all PC compatible
machines. Its command keys are very similar to those of the famous
BRIEF editor (by UnderWare Inc.). TERSE can edit both UNIX and MS-DOS
style text files as well as binary files. No hacker's disk is complete
without it. No disk, be it hard or floppy, is too full to include it.
TERSE is free (but copyrighted) to private users. If you are a private
user who uses TERSE "for pleasure", you are not required to register.
However, if you use TERSE for any commercial application, i.e., in
your company, at work, etc., or make money from selling software or
distributing shareware, you are *required* to register your copy of TERSE.
Registration cost is only $15 and buys you a personalized version, and
grant your institution a site license. Yes, this is correct, the whole
site such as a university with all its PCs, need only register once.
For an additional payment of only $5, you get the source code of TERSE.
Highlights
==========
o Very small: fits in 4096 bytes = 4 clusters on 5.25"/3.5" floppies.
o Minimal free memory requirements: 137KB.
o Uses current screen size, including the most common 80x25 screen
dimensions but also unusual sizes such as 40x16, 40x25, 40x40,
40x50, 132x25, 132x43, 96x33, 80x30, 80x33, etc.
o Fully DESQview (version 2.0 and above) aware.
o Edit binary files. TERSE is ideal for a quick and dirty job
of editing and patching strings in small programs.
o Supports editing of UNIX style files (lines terminated with '\n').
o Supports both '/' and '\' as directory separator.
o Edit lines of unlimited length (limited only by file size).
o Automatic unlimited horizontal scrolling.
o BRIEF-like keyboard configuration.
o Support for TABS, and configurable tab positions.
o Prevents snow when run on a CGA screen.
o CUT, COPY and PASTE
o SEARCH, SEARCH again, and TRANSLATE commands.
o Safe: confirm exits when text is not saved.
o Edit files whose name contains spaces and other weird names.
o Extended version (the SLIM editor) of size ~5k with many more
features, including support (via external filters) for word count,
sorting, charcter codes translations, quoting, tab expansion and
unexapnsion, and other complex editing tasks.
o Status line indicating: current column, current line, horizontal
scrolling, total number of lines, file name, modified status,
insert/overwrite status, the current offset in file and total file size
in bytes are dispalyed in the status line. The extended version
also displays the HeX value of the current char.
Requirements
=============
o PC-DOS/MS-DOS version 2.0 or higher
o 137KB free memory
o 64KB free disk space
Problems, Questions, Suggestions?
=================================
Please do not hesitate to communicate all your thoughts and comments.
I answer all my E-mail usually in less than 24 hours. If you do not
get a response within a reasonable time, it is probably because I didn't
get your message, or because I wasn't able to reply. Kindly try sending
again using another route, and include more alternate return paths.
Any comments you may care to make are valuable to me. The editors and
the included software would not have been what they are today without
all of the generous aid users provided: requests, complaints, thoughts
and even gripe are always welcomed.
Compatibility
=============
TERSE uses only pure 8088 instructions and assumes the bare minimum
of the underlying operating system. It should run on your good
old original 4Mhz IBM-PC running under DOS 2.0 as well as on a fast
80486 50Mhz machines running DR DOS 6.0 + 4DOS 4.0, or OS/2 in DOS
compatibility mode. More than once during the development, I had a
chance to save a few bytes by using a more advanced instruction, or
by assuming a more advanced operating system version. I managed to
resist this temptation. Other than that every dirty assembly trick I
could think of was used. It is conceivable that some of the tricks
could prevent TERSE from running on some DOS-like environments and
simulators, although I don't know of any concrete example.
UNIX style files
================
TERSE edits UNIX style files directly. That is, TERSE uses
both '\n' (aka LF, aka Line-Feed) and a '\r\n' (aka CRLF, aka
Carriage-return + Line-feed) combo for line ends. Hitting ENTER
puts '\r\n' into the file, and Ctrl-ENTER puts '\n'. (Configuration
utilities allow swapping these 2 keys.) Thus, you can transfer UNIX
text files to your PC, edit them on the PC, and then transfer them
back without need for file conversion.
Binary files editing
====================
TERSE can edit binary files as well. To aid in this task, the
status line displays the file size in bytes and the current offset
in bytes in the file. The status line of the SLIM editor displays
the hexadecimal value of the current char. (This feature may be
added in the future, space permitting to TERSE.) A difficulty in
editing binary files is that the following characters: space (ASCII 32),
Null (ASCII 0), and Meta-Del (ASCII 255) all look the same. If you have
an EGA or VGA screen you may want to use the font loaders WITHFONT or
LOADFONT together with the binary editing font and circumvent
this difficulty.
Configuration Utilities
=======================
The configuration utilities allow you to: swap the Enter and
Ctrl-Enter keys, change the tab size to 2/4/8/16 (I personally prefer
tabs set every 4 characters), and modify the key assignments (with
some minor restrictions). In addition, you can eliminate the snow
check done automatically on CGA screens, and you get better support
(as described above) for editing binary files on EGA/VGA screens.
Future
======
The main constraint in adding features to TERSE is that its total
size must be exactly 4096 bytes. All additions are dependent on my
ability to squeeze the current code further. I usually work several
hours, and sometimes days, for each byte squeezed. And this task is
getting harder and harder all the time. (A few versions had a slack
of very few bytes. In these versions, a few dummy bytes were appended
to the program to keep its size 4096 bytes exactly.)
I have several other possible directions for the development of TERSE.
These directions are: ``the TERSE family'' and ``the TERSE library''.
I am looking forward to hearing from _you_, the user, about what you
think of these ideas.
The TERSE library is an object code library which could be invoked
from a C program. The members of the TERSE family are:
LEAN A 3K file viewer. This is basically TERSE without the
editing code. Naturally, LEAN could never compete with the
excellent LIST utility of Vernon D. Buerg, and other
fine tiny file-listers.
SLIM An extended TERSE version (at the 5K level) with some extra
features. Some features for which I have received requests
and which have not yet been implemented are:
o Backward search.
o Edit next file in command line.
Files
=====
TERSE is distributed in two forms: the full distribution and an
abridged version. The full distribution consists of all the files
listed in the file 00-files.lst. Here is some more information on
some of the files. (files marked with * are missing in the
abridged version.)
T.COM The actual TERSE editor program. No other files are
necessary for proper operation of TERSE.
VER-HIST.DOC Versions history.
DISCLAIM.DOC Disclaimer of warranties.
TERSE.DOC This file. The documentation for the program. All the
above .DOC files may be printed by:
PRINTDOC.BAT A batch file for printing the documentation of TERSE.
_DESC.BTM A 4dos batch file for creating file name description
for the above files.
L.COM* A pre-release of the LEAN file lister.
S.COM* A pre-release of the SLIM editor, an extended version of
TERSE.
H.COM* A pre-release of SLIM built especially for the HP 95lx
palmtop computer. You can use the configuration
utilities to limit the file size to 32KB, thus reducing
the memory requirements. The help screen is minimized to
16x40 chars. The program has special code for detecting
the HP9LX, and if one is detected, only the top left
16x40 part of the virtual screen is used.
TCONFIG.COM* Configuration program for T.COM.
SCONFIG.COM* Configuration program for S.COM.
LCONFIG.COM* Configuration program for L.COM.
HCONFIG.COM* Configuration program for H.COM.
TKEYS.COM* Keyboard configuration program for T.COM.
SKEYS.COM* Keyboard configuration program for S.COM.
HKEYS.COM* Keyboard configuration program for H.COM.
MXIFY.COM* A pre-release of a program which gives TERSE and its
partners an EMACS style. Usage is:
MXIFY T filename
TT.BAT* Call terse on multiple files/wildecards
TTALIAS.BTM* Demo: make 4DOS aliases for terse
How to obtain TERSE
===================
TERSE is available from Simtel, Garbo, Wustl, their mirrors and from
other fine ftp archive sites. Some of these sites have mail-servers
for those who do not have access to ftp. Some of these sites carry
only the abridged distribution.
In addition, the latest version of TERSE is regularly deposited in
wuarchive.wustl.edu: /pub/MSDOS_UPLOADS/trsXXX[af].zip
Where XXX denotes the three digit version number. For example,
the full distribution of version 1.50 should be in a file named
ters150f.zip.
If you are experiencing problems downloading these files (cs.ubc.ca is
picky for no real reason sometimes), or if you don't have FTP access,
please drop me a line and I will e-mail to you whichever distribution
you are interested in. The full distribution is sent out in several parts
of about 1000 uuencoded lines each. The abridged distribution (basically
just the TERSE editor and the manual) goes in one part of about 600
uuencoded lines.
License (copying policy)
========================
The following policy is intended to promote free private use and
distribution, and to collect money from those who can afford to pay
for this software. In particular, those institutions which make money
from private users are requested to pass on part of their income to
whoever is responsible for generating it.
PRIVATE USERS: You are free to use, copy and distribute TERSE for
noncommercial private use provided that:
A) No fee is charged for use, copying or distribution.
B) It is not modified in any way.
C) It is distributed as a package. All files in this package must be
included, none should be added, and none should be changed.
Thus if you are a private user, you can *use* TERSE freely, and you
are under no obligation to register. (The only restriction is on its
further distribution.)
Registration (Private users)
============================
If you find TERSE a useful, easy, and nifty editor please show your
appreciation:-
Send the author the $15 US dollars registration fee.
Upon receiving your payment, I will send you
TERSE, the configuration utilities and, if you wish, a per-
sonalized version, and the author will do his best to update
them as soon as a new version comes out.
Please, do register if you can afford it, and if you would
like to support financially the production of this high quality
software.
NON_PRIVATE USE: Institutions and companies MUST register this package
after an evaluation period of 21 days. Registration of one copy per
company site is sufficient.
NON-PRIVATE DISTRIBUTION (Shareware distributors): You may distribute
this package as long as no more than a nominal fee (up to $10) per
disk is collected per disk.
NON-FEE DISTRIBUTION: Simtel/ Garbo/ other FTP collections: Obviously,
you may store this package and offer it to your users free of any
restrictions.
Author's Address
================
E-mail: (try addresses in this order)
yogi@cs.technion.ac.il (Technion -- Israel's institute of technology,
Haifa, Israel),
yogi@umiacs.umd.edu (University of Maryland, Maryland, USA)
yogi@cs.ubc.ca (University of British Columbia, Vancouver,
British Columbia, Canada),
Permanent mailing address is:
Joseph Gil,
P.O. Box 3148,
Jerusalem,
Israel.
Hebrew mailing address (you cannot read the following unless your
screen adapter can display Hebrew characters):
îëé ëæàë
3148 .â.Ü
ìëîÖàÿë
Genealogy
=========
TERSE is an exercise of editor writing inspired by TED, the famous
Tiny EDitor (written by Tom Kihlken and published November 1988 in PC
Magazine, Copyright 1988 Ziff Communications Co.). Some features of
TERSE are borrowed from the fine descendants of TED called TEDPLUS
(apparently also written by Tom Kihlken in November 1988) and TED2
(written by James E. Galbraith, 1201 Chase St., Novato CA, 94945, USA).
There is not a single piece of code in TERSE which is the same as in
TED, TEDPLUS or TED2. TERSE represents almost three years of work on
space optimization of the code, and on added functionality. Some of the
newly added features include help screen, unlimited line length, space
optimization of the code, and on added functionality. Some of the newly
added features include the help screen, unlimited line length, status
line, smooth horizontal scrolling, previous and next word, UNIX files
editing, search and replace, safety features and support for insertion
of all 256 characters of the IBM-PC extended ASCII set (including <Nul>,
<BS>, <CR>, and <LF>). Some old features include scrolling, cut, copy,
paste, and printing operations.
Some of the documentation for TERSE is based on the documentation
provided with TED2. See the article "The tiniest editor you'll ever
need" by Tom Kihlken, in the November 15, 1988 issue of PC Magazine
for further details concerning TED. TED, TEDPLUS and TED2 are
available from SIMTEL20:
TED PD1:<MSDOS.PCMAG>VOL7N19.ARC
TEDPLUS PD1:<MSDOS.EDITOR>TEDPLUS.ARC
TED2 PD1:<MSDOS.EDITOR>TED2.ZIP
TERSE is not related in any way to TED3.
DESCRIPTION
===========
Synopsis
t [filename]
To invoke TERSE, just type "T" from the DOS command line, optionally
followed by a filename.
File
----
TERSE opens and reads a file whose name (and path, if required) is
initially supplied on the command line. If no file name is provided,
TERSE opens a new file. A name may be supplied later during the
editing session using the "Output" command invoked by <Alt-O>.
TERSE expects a legal DOS filename, which may include a path name.
TERSE can also edit files whose names contain spaces. These names
are legal, although most DOS commands cannot manipulate them.
While editing, you can save your work by pressing <Alt-W>. Upon save,
the original of the modified file is saved with the extension .BAK.
To exit the editor and save your work press <Alt-X>.
To exit the editor without saving changes made to the file press
<Alt-Q>. Hitting <Alt-Q> causes the TERSE to exit immediately
if the file was not modified since last saved. Otherwise, TERSE
presents the following prompt:
Lose changes (Y/N)?_
Hit 'Y' only if you are certain that you don't want recent changes to
be saved.
Basic Editing
-------------
A help screen is available upon pressing <F1> or <Alt-H>. When the help
screen is displayed, pressing any key returns you to the text.
In TERSE, the cursor movement keys (Left, Right, Up, Down, PgUp, PgDn,
etc.) allow you to move around in the text. Text is entered in insert
mode by default. Text can be deleted using the <Del> and <BackSpace>
keys.
Pressing the <Alt-I> key will toggle between Insert and Overstrike mode.
The Insert/Overwrite state is displayed by an 'Ins' or 'Ovr' in the
status line.
Text can be deleted using the <Del> and <BackSpace> keys.
The <Alt-U> key restores up to 255 characters deleted by the <Del> key or
overwritten while in the Overwrite mode. The <Alt-U> key only restores
the last character deleted with the <Backspace> key.
TERSE text buffer is limited to 65535 characters. An attempt to extend
the buffer beyond that results in a short beep.
Lines
-----
Lines may be of any length. TERSE recognizes both the UNIX and DOS
conventions for line termination, i.e., both the <CR><LF> pair and a
single <LF> denote end of line. Off screen characters may be viewed by
moving the cursor toward them. Lines may be broken by pressing <Enter>
(insert <CR><LF> pair) or <Ctrl Enter> (insert <LF> character) at
any point, in either Insert or Overstrike mode. Lines may be joined
by pressing <Del> at the line end or <Backspace> at the beginning.
Pressing <Alt-D> deletes the entire line and closes the gap. Pressing
<Alt-K> deletes from the cursor position to the end of the present
line. Pressing <Alt-G> restores the most recent line deletion.
The line delete buffer remains intact until another line is deleted.
The line delete buffer has room for 255 characters.
Block
-----
A Block is some portion of the text file which has been specifically
delineated for later manipulation. One end of a "block" of text is
defined by hitting <Alt-A> key (anchor drop/raise). The other end of
the block is where the cursor is located. Move the cursor with the
cursor control keys to the block end. As you move the cursor, note
that the blocked area is shown in reverse video. The <Alt-A> is a
toggle key, so hitting it again raises the anchor dropped at the
block end, and thus cancel the blocking operation.
Pressing the <Keypad-> key (keypad grey minus key) removes the block
to a paste buffer; this operation is known as "Cut". The <Keypad+>
key (keypad grey plus) copies the block to the paste buffer without
removing it from the text; this operation is known as "Copy". The <Ins>
key copies the text stored in the paste buffer at any point where the
cursor is located; this operation is known a "Paste". The paste buffer
remains intact until another section is marked and cut or copied.
The paste buffer has room for 64K bytes.
When a block is marked, pressing <Alt-P> prints the marked text (directly
from the file buffer). After the print, the block remains marked.
Search and Replace
------------------
TERSE has a string "Search" and "Next" functions. When the <Alt-S>
key is pressed, the prompt "Search for: " appears on the bottom line.
Enter the desired text string and press the <ENTER> key. If the
string is found, it appears blinking in inverse video on the screen.
The blinking inverse video is extinguished when any key is pressed.
If the string is not found in the area following the cursor, a short
beep sounds. To search for the next occurrence of the string,
press <Alt-N>. TERSE cannot search backward, and it doesn't recognize
regular expressions.
TERSE also has a "Translate" function which is invoked by pressing
the <Alt-T> key. You are prompted for the string to search for,
and then for the replacement string. The "translate" function is
best explained by an example. To change all occurrences of the simple
"wrong" in your file into something more institutionally acceptable,
you would move to the beginning of the file (Press <Ctrl-PgUp>) and
then press <Alt-T>. TERSE erases the status line (the last screen
line) and displays in its place a prompt:
Search for: _
(The underscore in the above indicates the cursor position). Type in
the word: "wrong". The <BackSpace> key can be used for erasing the
previous character. The last line should now read:
Search for: wrong_
Hit <Enter>. (Hitting <ESC> at this stage ends the translate
operation.) TERSE now prompts you for the replacement string in the
last screen line:
Replace with: _
Type in, say, "policy directive inconsistent". (You can use up to 30
characters.) The last screen line now reads:
Replace with: policy directive inconsistent_
Hit <Enter>. (Again, hitting <ESC> at this stage ends the translate
operation.) TERSE searches for the first occurrence of "wrong" in your
file, moves the cursor to this point, displays "wrong" in blinking
inverse video, and then prompts you in the last screen line:
Replace with: policy directive inconsistent [Yes/No/All]?
Your response could be to hit 'Y' or 'y', which means Yes, make this
replacement; or 'N' or 'n' which means No, do not make this replacement.
In both cases, TERSE continues by moving to the next occurrence of the
string "wrong" and prompts you again. You may also answer the prompt by
hitting <Esc>, which aborts the translate operation. If you wish to
replace unconditionally all occurrences of the string "wrong" with "policy
directive inconsistent" (be warned that it may take a considerable time
for a long file), respond with 'A' or 'a'. TERSE marches through the
file and makes these replacements for you.
Search and Search - Replace are by default case insensitive. This means
that the search catches all of the following strings: wrong, Wrong, WRONG
wrOng, etc. Pressing <Alt-C> changes both Search and Search - Replace
to be case sensitive. Pressing <Alt-C> again returns you to the case
insensitive Search and Search - Replace. Note that a short message
appears in the status line whenever case sensitivity is toggled. This
message is erased, and the normal status line reappears, when you go on
with your work.
Character Set and Binary file editing
--------------------------------------
Any of the characters in the IBM extended ASCII set can be entered
and manipulated by TERSE. To enter control characters (ASCII 00-31
and 127), use <Ctrl-@>, <Ctrl-A>, ... , <Ctrl-Z>, <Ctrl-[>, <Ctrl-\>,
<Ctrl-]>, <Ctrl-^>, <Ctrl-_> and <Ctrl-Backspace>. A more general
method is to press the Alt key and, without releasing it, type a
character ASCII decimal value on the numeric keypad. The PC-BIOS
does not support entry of the <Nul> character (00h) in this fashion.
Instead, you may enter the <Nul> character by hitting the <Ctrl @> key.
The ASCII Backspace (BS) code can be entered as <Ctrl-H>, and the
<Backspace> key deletes the character to the left of the cursor.
Similarly, ASCII Carriage-Return (CR) and Line-Feed (LF) character
codes can be entered directly as <Ctrl-M> and <Ctrl-J>. TERSE
interprets the <LF> character as an end-of-line. A <CR> is considered
an ordinary text character except when it is immediately preceded by
a <LF>, in which case it is considered part of the end-of-line marker.
If <CR><LF> are entered together, or ever become adjacent, they cannot
be separated. The <Enter> key inserts an end-of-line marker <CR><LF>.
TERSE does not use the CP/M style End-of-file marker, <Ctrl-Z>, to
indicate the last character in a text file. If a <Ctrl-Z> character
appears in the file, it is shown as is.
The Screen
-----------
TERSE configures itself to the display adapter in use, and supports
text modes other than the standard 80 columns by 25 rows, e.g., EGA
43 lines and CGA 40 columns mode. <PgUp> and <PgDn> scroll the file
by the number of rows displayed. TERSE does not work properly if the
screen is initially in a graphics mode.
TERSE does not alter screen attributes or colors. Inverse video is used
in the status line and to indicate a MARKed block. TERSE uses blinking
inverse video to indicate that the search string has been found.
It automatically handles "de-snow" on a CGA display.
Because TERSE makes BIOS calls and writes directly to the screen
buffer, it would probably not work properly on MS-DOS computers that
are not sufficiently IBM-PC compatible.
The Status Line
---------------
At the bottom of the editing screen is the Status Line. The Status
Line constantly displays information regarding the file you are
currently editing. The Status Line is shown below with a description
of the information displayed.
+--------------------------------------------------------------------------+
:F1 Help | Line 137 Col 25 =282 +0 @893 #10324 Ins letter.doc* :
+---+----------+--------+-------+-----+---+------+-----+-----+------+------+
: : : : : : : : : File modified
: : : : : : : : : since last
: : The current : : : : : : written
: : cursor column : : : : : :
: : number : : : : : The name of file
: : : : : : : you are editing
: The current : : : : :
: cursor line : : : : +Insert mode is ON
: number : : : :
: : : : +File length in characters
A reminder that : : :
Help screen is : : +Current offset in file
available upon : :
pressing the : +The number of columns scrolled off
<F1> key : to the left of the screen
:
+The total number of lines in the file
┌──────────────────────────────────────────────────────────────────────────────┐
│F1 Help | Line 137 Col 25 =282 +0 @893 #10324 Ins letter.doc* │
└───┬──────────┬─────────┬───────┬─────┬─────┬───────┬─────┬─────┬──────┬──────┘
│ │ │ │ │ │ │ │ │ File modified
│ │ │ │ │ │ │ │ │ since last
│ │ The current │ │ │ │ │ │ written
│ │ cursor column │ │ │ │ │ │
│ │ number │ │ │ │ │ The name of file
│ │ │ │ │ │ │ you are editing
│ The current │ │ │ │ │
│ cursor line │ │ │ │ └Insert mode is ON
│ number │ │ │ │
│ │ │ │ └File length in characters
A reminder that │ │ │
Help screen is │ │ └Current offset in file
available upon │ │
pressing the │ └The number of columns scrolled off to
<F1> key │ to the left of the screen
│
└The total number of lines in the file
ADVANCED FEATURES
=================
Word wrap
---------
SLIM can do automatic word wrap as you type. Upon pressing <Alt-M>,
SLIM prompts you for a right margin:
Margin:_
Type in your preferred right margin setting (72 is pretty common and
useful selection). If a right margin is set, then whenever you finish
typing a word (i.e., when you hit a <Space> or <Tab> key) SLIM checks
if this margin was exceeded, and if so, the last word typed is wrapped
to the next line.
If the right margin is set to 0, then word wrapping is disabled will
occur. By default, the right margin is 0. This default can be changed
with the SCONFIG configuration program.
Swap Cursor and Mark
--------------------
An easy way to go to the begining or the end of a marked block the "Swap
Cursor and Mark" command. Upon pressing <Shift-Tab>, the cursor position
is swapped with mark position.
Exchange Marked Block with Paste Buffer
---------------------------------------
Many users are familiar with the CUT/COPY/PASTE paradigm for manipulating
chunks of texts. In TERSE you block a piece of text by dropping a mark
(<Alt-A> key) at its beginning and then moving the cursor to its end.
You can then COPY (keypad +> key) the blocked text to a paste buffer,
or CUT (<Keypad+> key) it to the paste buffer. Later, you can move to
a different location and PASTE the text, i.e., insert the text in the
paste buffer.
SLIM adds to these three basic operations yet another one: "Exchange
Marked Block with Paste Buffer", or for short EXCHANGE. By default, this
command is bound to <Keypad*> key (keypad grey asterisk). Upon pressing
this key, the contents of the currently marked block is exchanged with
the current contents of the paste buffer. Hitting <Keypad*> again
effectively undoes this operation.
The EXCHANGE operation should come in handy in situations where you
need to shuffle a lot text around. An important application of this
operation is discussed next.
Pump Block Through Filter
-------------------------
The term "filter" is borrowed from UNIX. It refers to a program, which
takes input from the standard input, processes it, and then produces
output to the standard output. Several filters are supplied with a
separate filters archive. For example, the WC filter produces to the
standard ouptut a count of the number of lines, words and characters
in the standard input.
The "pump block through filter" command, by default bound to the
<Alt-F> key, runs a filter while supplying the currently marked block
as input to the block and capturing the filter's output. When the
filter finishes, its output will show as the currently marked block.
The previous contents of the marked block are moved to the paste buffer.
By pressing <Keypad*> you can exchange the contents of the block and of
the paste buffer, effectively undoing the filter operation.
Thus, to count the number of words in a document, follow these
easy steps:
1. Hit <Ctrl-PgUp> to move to the top of the file.
2. Hit <Alt-A> to drop an anchor.
3. Hit <Ctrl-PgDn> to go to the end of the file. The whole
file should be marked now.
4. Hit <Alt-F> to invoke the "pump block through filter" command.
Upon doing so, SLIM prompts you for the name of the filter
Filter: _
5. Type in 'wc -w' and hit <Enter>. (The -w flag tells WC.COM
to produce word count only)
6. The number of words in the document now shows, while the document
itself is erased.
7. Hit <Keypad*> to restore the documents contents, and erase the
word count. Later you can hit <Ins> to paste the word count
wherever you may need it.
I distribute separately an archive of many filters, including NFMT
filter, which reformats text using smart line breaking algorithm. All
of TERSE documentation was formatted using this filter. To reformat
a piece of text, I simply mark it (usually the whole paragraph),
and invoke the nfmt filter. Some other filter included with that
archive are the DOS equivalents of the some famous UNIX filters:
EXPAND, UNEXPAND, UUDECODE, and CAT. The QUOTE filter is useful in
composing e-mail messages. The ROT13 filter allows you to decrypt
and encrypt spoilers etc.
Many more new features can be easily added to SLIM by virtue of this
command. A few examples are: date and time stamping, sorting, column
summation, character sets conversions, directory contents listings
etc. Sophisticated users should probably get copy of a DOS port of
the famous UNIX 'sed' and 'awk' filters, and harness their power to
enhance SLIM.
The "pump block thru filter" command does not use temporary files,
and can be run with even when the disk is full. Programmers may enjoy
contemplating how this little wonder was implemented. (If you really
cannot figure this out, write to me and ask for a clue...)
The "pump block thru filter" command does captures also the standard
error of the executed filter. You can thus run your favourite compiler
from within SLIM.
Go to Line
----------
If you use the "pump block thru filter" to invoke a compiler, you may
find it useful to be able to find a line by its number. To invoke the
"go to line" command press <Alt-G>. Upond doing so, SLIM presents the
following prompt:
Go to line: _
Type in the desired line number and hit <Enter>.
KEYBOARD SUMMARY
=================
The following is a description of all TERSE commands and their key
binding. To get a help screen with keyboard usage summary, hit <F1> or
<Alt-H>.
Cursor movements
-----------------
<Left Arrow> Moves cursor left one column
<Right Arrow> Moves cursor right one column
<Ctrl Left Arrow> Moves cursor to the beginning of the next word.
<Ctrl Right Arrow> Moves cursor to the beginning of previous word.
<Home> Moves cursor to start of line
<End> Moves cursor to end of line
<Up Arrow> Moves cursor up one row
<Down Arrow> Moves cursor down one row
<PgUp> Moves text window up one page
<PgDn> Moves text window down one page
<Ctrl PgUp> Moves cursor to top of file
<Ctrl PgDn> Moves cursor to bottom of file
Basic editing operations
------------------------
Any keyboard char Insert/Overwrite character into file
<Tab> Insert tab character
<Enter> Start new line, add <CR><LF> pair to file.
<Backspace> Delete character to left of cursor
<Del> Delete character under cursor (to right)
<Alt-U> Undo recent <Del> operation/Overwritten
characters.
<Alt-I> Toggle between Insert/Overwrite mode (Ins/Ovr)
<Alt-K> Delete to end of line
<Alt-D> Delete current line
<Alt-Y> Restore deleted line (up to 255 characters)
Block Operations
----------------
<Alt-A> drop/raise Anchor. Block is between anchor and
cursor.
<Keypad-Plus> Copy block to clipboard buffer
<Keypad-Minus> Delete block to clipboard buffer
<Ins> Paste from clipboard buffer
<Alt-P> Print block.
Search
------
<Alt-S> Search for string
<Alt-C> Toggle search case sensitivity.
<Alt-N> Find next occurrence of string
<Alt-T> Search and Translate
File Operations
---------------
<Alt-Q> Quit edit: no-save exit (asks for confirmation)
<Alt-X> eXit and save: same as Quit if file name is unknown
<Alt-O> Change output file name. Supply name if not given.
<Alt-W> Write the current buffer into its file (if
filename known)
<Alt-R> (in SLIM only) Read a file to buffer.
<Alt-E> (in SLIM only) Edit another file.
Scrolling
---------
<Alt--> Scroll window horizontally to the left
<Alt-+> Scroll window horizontally to the right
<Ctrl Home> Scroll window up
<Ctrl End> Scroll window down
Misc
----
<Alt-I> Insert/Overwrite toggle.
<Alt-Z> Push to dos.
F1 Display the help screen.
<Alt-H> Display the help screen.
<Alt-M> (in SLIM only) Set right margin for word wrap.
<Alt-G> (in SLIM only) Goto line.
Entering Special Characters
---------------------------
<Ctrl @> Enter the [NUL] character
<Ctrl A> Enter the [SOH] character
... All ctrl characters can be inserted this way
... Special control characters are described below
<Ctrl C> Enter the [ETX] character (DOS abort disabled)
... ...
<Ctrl H> Enter the [BS] character
<Ctrl I> Enter the [TAB] character
<Ctrl J> Enter the [LF] character
... ...
<Ctrl M> Enter the [CR] character
... ...
<Ctrl Z> Enter the [SUB] character (No CP/M style EOF)
<Ctrl [> Enter the [ESC] character
<Esc> Enter the [ESC] character
<Ctrl \> Enter the [FS] character
<Ctrl ]> Enter the [GS] character
<Ctrl ^> Enter the [RS] character
<Ctrl _> Enter the [US] character
<Ctrl Backspace> Enter the [DEL] character
KNOWN BUGS AND FUTURE DIRECTIONS
=================================
o Horizontal scrolling does not move the cursor position, so by
pressing <Alt-+> and <Alt--> you can scroll to the right
or to the left but only to the extent which leaves
the current cursor position visible. For example when the
cursor is in the left most column, no horizontal scrolling
is possible. There are no plans for modifying this behavior
as the author feels that it is very reasonable. Strong user
pressure may change this.
o <Alt-U> only restores the last character erased by
<Backspace>. (Future plan is to push deleted characters (by
<DEL>, <Backspace> and overwritten characters) to a stack.
The stack will have limited depth, and as characters
are pushed in, old characters stored deeply in the stack
disappear. The <Alt-U> will pop characters from the stack
and insert/append them.)
o Editing can get extremely slow if lines are excessively long.
Lines longer than 20,000 characters cause a noticeable
delay after every editing operation on these lines.