home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
e
/
ed21.zip
/
ED.DOC
next >
Wrap
Text File
|
1993-03-07
|
16KB
|
401 lines
ED 2.1
Full-screen Editor
by
Bob Eyer
[73230,2620]
Mar 7, 1993
Note: See Rationale section at the bottom of the text, and the
enclosed SHARE.TXT file, showing how you can obtain copies
of my other work.
Syntax
------
ED Filespec [/rows]
Environment
-----------
SET ED=xC
x: color index number
C: accept external cursor default
F8 key quits
Definitions
-----------
Filespec A text file or wildcard specifying one or a range
of text files. ED recognises all standard DOS
shortcuts, such as
ED . or ED ..\.
meaning
ED *.* or ED ..\*.*
or
ED SYS
meaning
ED \SYS\*.*
ED accepts files which have either only the reset
attribute or only the archive attribute; all other
combinations of attributes will abort processing
with the message "Wrong attribute(s)".
Selection of a wildcard causes ED to present a
"select" window in the status line; if you don't
like the selection, just hit the F8 key and enter a
new wildcard. Entering a new wildcard does not
erase the old one; Filespec is a CUMULATIVE
wildcard handler. (See discussion of Ctrl-N
below).
You may move through the resulting cumulative
selection list by using your Up and Dn cursors.
A filespec should not be longer than 40
characters. ED allocates 40 bytes for each
complete filename and allows for a maximum of 640
filenames.
rows The maximum number of lines of video display.
If not given or if set to *, ED will detect whether
the screen is in 25, 43, or 50 line mode. If your
monitor does not support 43 or 50 line mode, the
routine defaults to 25 lines.
If the status line does not appear at the bottom of
your screen, the detection routine is not working
for your monitor and manual override will be
necessary.
The * entry for rows makes it possible to put the
ED command line in a batch file, without
prejudicing the question whether your video is in
43 or 50 line mode.
ED does not support 132-column modes.
If no parameter is entered on the command line, ED will simply
return a simple help screen.
Environment
-----------
ED sets color and cursor default via the environment. The general
syntax is -
SET ED=xC
where x is a color number. See Colour section below.
If x is not set, the program defaults to 27 (bright cyan on blue).
If C is added to the ED environment string, ED preserves whatever
cursor shape was present prior to loading the program. This
feature is useful primarily to users of block cursors (see CFIX
program in my SUTL package). If C is not added to the environment
string, ED takes action to define the cursor size to be the
standard double bottom line.
Example:
SET ED=48C
This string sets ED's colour to be black on cyan background so as
to accept any externally defined default for cursor size. 'SET
ED=48' forces the cursor to be standard.
To remove ED from the environment, use the DOS command
SET ED=
Changes
-------
2.1 - Advertising screen shifted to avoid flash on single
element wildcard loads.
- Initial position of wildcard array shifted to agree with
first element in each new series.
- Standard column feature limited to first 40 positions of
each line.
- Cursor shape control added to environment (see above).
Full Screen Edit
----------------
The following is a table showing the meaning of ED's edit
control keys.
Key Meaning
------ --------------------------------------------------
F8 Exit without saving data.
The universal quit function was assigned to F8
largely as an alternative to using the Esc key.
The chief advantage of not giving functional
meaning to the Esc key is to permit the editor to
receive ANSI escape sequences without
misinterpreting them.
* Ctrl-Z Exit saving data to file.
This one is the 'hard save'; that is, Ctrl-Z
writes the file back to disk regardless whether
it was changed in the editor (an unconditional
save).
* Ctrl-N Load new file or select from a wildcard of files.
Will save data to old file before loading new
file, only if there was any attempt to change old
data (soft save).
In addition, this function does not wipe out the
old wildcard previously in memory; instead, it
simply adds the new wildcard information to the
old. This makes it possible to obtain full use
of the Select function F9 in situations where
more than one wildcard is needed, or where the
files needed in the Select array are not related
to one another by wildcard definition.
* F9 Present old file list for new select.
As does Ctrl-N, this will save data to old file
before loading any new file, only if the old data
were changed (soft save).
To inject new wildcard, use Ctrl-N.
* Ctrl-W Periodically save data during session (AUTO-SAVE).
When activated, ED automatically saves all data
once every three minutes on any line change,
provided that the file is changed (soft save).
Ctrl-D Delete current line and put it in the delete
buffer.
Ctrl-Y Insert delete buffer at current line.
Ctrl-L Insert blank line.
Ctrl-O Toggle word-wrap status.
Default is to enable word-wrap.
Ctrl-I Set right margin for word-wrap.
Default is column 71. To set, simply move cursor
to desired column and then hit Ctrl-I.
In the event word-wrap is turned off temporarily,
ED remembers the previous right margin setting
for new Ctrl-O toggle.
F1 Mark first line for cut and paste operations.
This function also clears the paste buffer.
F2 Mark last line for cut and paste operations.
This function also copies all lines between the
first and last lines inclusive into the paste
buffer.
The copy function will not work at all, where
either the number of lines to be copied exceeds
500 or the number of lines copied plus the number
of lines in the file exceeds the RAM handling
capacity of the program (generally, as much as
5000-6000 lines).
F3 Cut all text between the first and last lines
marked, inclusive.
The cut affects only lines to be saved to the
input file, not the paste buffer. Therefore,
after marking the desired text with F1 and F2,
the user may proceed to cut and then paste at
his desired location.
F4 Paste all text between the first and last lines
marked inclusive into current document at the
position of the cursor.
This function can be executed any number of times
up to available RAM capacity, since ED does not
clear the paste buffer except on use of the F1
key.
F5 Prompt for search string, then search from top of
file to find first occurrence. (case insensitive)
F6 Continue to search for next occurrence.
After last match, returns to prompt for new
search string (uses previous search string as
default if none is selected). Since F6
automatically returns to the F5 function (which
begins searches from the top of the file), there
is no need for a reverse search string function.
F7 Split text from cursor to next line.
Up Previous line.
PgUp Previous page.
Ctrl-PgUp Top of file.
Dn Next line.
PgDn Next page.
Ctrl-PgDn Bottom of file.
Right Move right 1 character.
Left Move left 1 character.
Tab Move right 10 characters.
Beyond right margin, cursor flips to column 1.
[tab stops: 1, 10, 20, 30, 40, 50, 60, 70, 80]
Home Move cursor to column 1.
End Move cursor to end of current line.
Ins Insert mode on/off (default is off)
Backspace Move left all text right of cursor including
cursor ("destructive backspace").
Del Delete character at cursor position moving
remaining characters one position to the left.
If you don't wish ED to alter your data file in any way, do not
use the functions which are asterisked in the table above.
Status Line
-----------
The status line presents the following data in order: the file
name, current line number, column number, insert status, word-wrap
status, and the system time. The remainder of the line is used
for warnings, reminders and transient status messages, such as how
many lines are in the paste buffer (if any).
Following the Status Line are two lines of help, covering only
those keys that may be difficult to remember.
File i/o
--------
ED is programmed to suppress the cursor when loading or updating a
file.
At runtime, ED displays the message
WARNING: File overflow
if the file selected contains more than the line limit or
WARNING: Line xyz truncated
if the file contains line(s), the first of which xyz, truncated to
80 characters in RAM. In either case, ED beeps 3 times to draw
attention to the danger. The correct exit to use is via the F8
key, NOT Ctrl-Z or any soft save.
If you save a file which raises either message on the status line,
the file will be damaged, unless you quit via F8.
Otherwise, where the load is normal, ED displays the message
^W auto-save
If you intend to do any file editing at all, you should activate
auto-save directly you have the file on screen by hitting Ctrl-W,
causing the reminder to be replaced by the message
AUTO-SAVE ON
In the event of an accident you will then lose at most three
minutes of data changes.
If no line is changed when auto-save or any other soft save
function is invoked by ED, no disk write will actually take
place. A disk write will always take place, however, on use of
the hard-save Ctrl-Z function.
Whenever a disk write takes place ED beeps the speaker once.
Free memory
-----------
ED allocates all available RAM for itself and the file it loads,
and requires a minimum of about 140k free. If that much is
unavailable, ED will terminate with a message about insufficient
memory.
Colour
------
ED's color default is 27. But you can change it by using the
table below (see Environment discussion above).
Back Fore Bright Fore
---- ---- -----------
Black 0 0 8
Blue 16 1 9
Green 32 2 10
Cyan 48 3 11
Red 64 4 12
Magenta 80 5 13
Brown 96 6 14
White 112 7 15
The correct number is found merely by adding the Foreground to the
Background desired. For example, Bright Green on Blue background
is 10 + 16 = 26.
Avoid settings above 127. Values above that limit will produce
blinking displays.
In my estimation the numbers best for the eye are 10, 11, 14, 15,
26, 27, 30, 31, 74, 75, 78, 79 and 112. But you may have other
ideas.
Rationale
---------
I wrote this editor originally as an extract from ADL, my
phone-canvassing program (See SHARE.TXT for details).
However, it remains a useful small editor, especially as a
replacement for EDLIN. There are a number of competing small
editors, such as Wilmott's SLED. But few of them have all the
features I wanted.
ED begins to set a new baseline in small editors. It has
sophisticated wildcard support, allowing even those files not
related by wildcard to be stored in the Select buffer, so as to
make it a simple matter to switch among many files (see F9 key).
It also has color and screen resolution support, and it has a
feature which I have always wanted in an editor: automatic
periodic saves. A big problem with existing editors is loss of
data on power down or other unanticipated events. ED's auto-save
feature solves most of this problem.
The most important features which ED lacks are (1) handling of
lines longer than 80 characters and (2) word-wrap and
right-justified paragraph formatting.
These issues are high on my agenda for the next version.
-------------------------
End of documentation