home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
usenet
/
altsrcs
/
1
/
1558
/
simped.doc
< prev
next >
Wrap
Text File
|
1990-12-28
|
9KB
|
329 lines
simped() Unix SysV simped()
Name
simped - a simple, bbs style editor.
Syntax
simped [-a] [-p] [filename]
(Note: only one file may be specified at a time)
-a Causes the editor to always come up in append mode. This
fits nicely with the first 15 lines listed on entry. (Note:
the number of lines listed is configurable).
-p Compatibility for postnews/inews. Because of the way
blank lines are stored by simped, inews deletes the first
line of text. This option will add a line with two dashes
"--" at the end of the header provided by postnews.
Example for calling simped from a menu:
EDITOR="/.../simped -p"; export EDITOR
postnews
EDITOR=".../simped"; export EDITOR
Description
simped is a simple line oriented editor for use by people
who don't want to spend time learning a more flexible
editor like ed, ex or vi. It was designed with the intent
that useful work could be done immediately and without
reading this manual page or any of the online help.
In keeping it simple much flexibility is lost. In an effort
to recover some of this and allow simped to act as a bridge
to more flexible editors, some commands may be wholly or
partially entered on a single line instead of a separate
line for each portion of a command.
For example: those commands that require line numbers may
be entered one of two ways:
Command? d <RETURN> (delete a line)
Line number: 1 <RETURN>
-or-
Command? d1 <RETURN>
Also an extra editing command (Modify) has been added which
(once learned) makes editing much easier. Though there is
no complement to this command in any Unix editor, it does
regain some editing flexibility.
Program entry
If no file is named on the command line, or the file is a
new file, an introductory message is printed and the user
is placed directly into input mode with the prompt:
1> _
simped 64 Page 1 simped
simped() Unix SysV simped()
If the file exists, the last half page of text is listed
and the:
Options: S)ave and quit, A)bort/cancel, L)ist text, E)dit line,
I)nsert line, D)elete line, C)ontinue, M)odify, H)elp
Command? _
prompt is displayed, unless the -a option is specified, then
the user is dropped directly into C)ontinue mode.
The number of lines listed is set at compile time by the
#define'd value PAUSE.
Input mode
While in input mode characters typed in are placed in a
buffer. If the text being typed in spills over the end of
the line, it is automatically moved to the next line and
typing continues uninterrupted.
Entering a <RETURN> on a line by itself will exit input
mode and display the command prompt.
If you want a blank line, enter a space and <RETURN>.
The length of the lines is set at compile time by the
#define'd value LINELEN.
Command options:
* S)ave and quit
Saves the file and quits the editor.
No options.
* A)bort/cancel
Verifies that no save is to be done and then abandons any
editing that was done.
No options.
* List text
Lists the text entered, pausing every half page or so. The
number of lines listed is set at compile time.
Options: A starting line number may be entered. A return
will start listing at line 1.
simped 130 Page 2 simped
simped() Unix SysV simped()
* Edit line
Substitute old text for new text on a line.
Example 1:
Command? e <RETURN>
Line number: 1 <RETURN>
1> A line of text
Old text: f t <RETURN>
New text: f modified t <RETURN>
1> A line of modified text
(returns to the command prompt)
Example 2:
Command? e1/f t/f modified t/
1> A line of modified text
(returns to the command prompt)
To insert characters at the beginning of a line, enter
nothing for the "Old text:" and the characters to be
inserted for the "New text:".
To delete characters, enter them in the "Old text:" and
nothing in the new text.
Entering nothing in both "Old text:" and "New text:" will
result in no change.
* Insert line
Insert lines of text BEFORE the line number specified. The
user is dropped into 'insert mode'.
Option: The line number you want the inserted text to
appear BEFORE.
* Delete line
Delete a line. The line will be printed and you must enter
a 'y' for the line to be deleted.
Option: The line number you want deleted.
simped 196 Page 3 simped
simped() Unix SysV simped()
* Continue
Continue entry. Drops the user into input mode AFTER the
last line in the file.
No options.
* Help
An online source of information about commands.
* Modify
This is a multi-use editing function added in a effort
to regain some of the flexibility lost in making this
editor simple.
Option: The line number you want to modify.
This command can:
- replace text
- put blanks in place of characters
- delete text
- insert text
The line is printed and and the cursor is placed under the
first character on the next line. Changes are made by placing
one or more of the available options below the portion of
the line.
OPTION EXPLANATION
------ -----------
^text# Inserts the characters between the '^'
and the '#' BEFORE the character
pointed to by the '^'. Inside the '^'
and the '#', both the '&' and the '^'
are treated as regular characters.
^# Inserts a # before the ^ (special case)
# (When not the first character after a
'^') causes the character above it to
be deleted and the space closed.
& Replaces the character above it with a
blank space.
(space) No effect.
ANY OTHER CHARACTER WILL REPLACE THE CHARACTER ABOVE IT!
========================================================
simped 262 Page 4 simped
simped() Unix SysV simped()
Example:
Command? m1 <RETURN>
1> Thos sentence isstoobbe mortifd
edit> i ^is the #### #& d ^ie#
1> This is the sentence to be modified
Command? _
Bugs
If the terminal erase character is set to something other than
^H (\010) like DEL, hitting a BS will place a ^H in the text.
/*
* Copyright (C) 1990 by Jay Konigsberg.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation is hereby granted, provided that the above copyright
* notice appear in all copies and that both the copyright notice and
* this permission notice appear in supporting documentation. This software
* is provided "as is" without express or implied warranty. However, the
* author retains all Copyright priviliges and rights to renumeration if
* this software is sold.
*/
(Translation: you may use this software freely, but if you sell it, I get
some money. The amount depends on the selling price).
simped 328 Page 5 simped