Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

defaultsedit(1)

kill(1)

setkeys(1)

suntools(1)

TEXTEDIT(1)  —  USER COMMANDS

NAME

textedit − mouse and window oriented text editor

SYNOPSIS

textedit [ −generic_option generic_params ... ] [ −EH ] [ −Ea on|off ] [ −Ei on|off ] [ −EL N ]

[ −Em N ] [ −ES N ] [ −ET N ] [ −En N ] [ −Eo on|off ] [ −Er on|off ] [ −Es N ]

[ −Eu N ] [ −EU N ] [ −Ec N ] filename

DESCRIPTION

textedit is a mouse-oriented text editor that runs within the SunView environment. 

When invoked, textedit creates a window containing two text subwindows.  The much smaller, top subwindow (known as the scratch window) is used for keeping small pieces of text in, such as directory and file names.  The bottom subwindow is used to display and edit the file specified on the command line (or simply serves as a large scratch area if no file was specified).  The name of the file currently being edited is displayed in the left-hand portion of the name stripe.  The name of the current working directory is displayed in the right-hand portion of the name stripe. 

For a description of how to use the facilities of the text subwindows, see Windows and Window-Based Tools: Beginner’s Guide. 

If textedit hangs, for whatever reason, it can be forced to try to write out the edited version of the text by sending its process a SIGHUP, usually via a command line of the form:
kill -HUP pid
The edits will be written to the file textedit.pid in the current working directory.  If the write fails, textedit tries /usr/tmp, then /tmp.  In addition, whenever textedit catches a fatal signal, such as SIGILL, it tries to write out the edits before aborting for a post-mortem. 

DEFAULTS OPTIONS

There are several dozen user specified defaults that affect the behaviour of the text subwindow facilities.  See defaultsedit(1) for a description of how to browse and edit these defaults.  Important default entries in the Text category to be aware of are:

Edit_back_char The character that, when typed, erases the character just before the insertion point.  The default value is DEL.  This, and the following editing characters, can only be specified via use of defaultsedit; in particular, stty(1) cannot be used to set the erase character. 

Edit_back_word The character that, when typed, erases the word just before the insertion point.  The default value is CTRL-W. 

Edit_back_line The character that, when typed, erases the portion of the line before the insertion point.  The default value is CTRL-U. 

Checkpoint_frequency 0 is the standard default; it means that no checkpointing will take place.  For a value n greater than zero, checkpointing will take place after every nth edit.  Each character typed, each Get, and each Delete counts as an edit.  If the file being edited is named foo, at each checkpoint, an updated copy of the file will be saved in foo%%. 

COMMAND LINE OPTIONS

−generic_option
textedit accepts the SunView generic tool arguments; see suntools(1) for a complete list of generic_options. 

−EH textedit outputs a page of helpful information to stderr and then exits.  (−text_help is a synonym for this option.) 

−Ea on|off If the parameter value is on, adjusting a selection span has the side-effect of making the selection pending-delete.  This option (or the synonym −adjust_is_pending_delete) corresponds to, and overrides, the Text package’s defaults database entry Adjust_is_pending_delete, which has default value False, meaning off. 

−Ei on|off If on, typing a newline indents the created line to match the indentation of the previous line.  (Synonym is −auto_indent; overrides default Auto_indent which has value False.) 

−EL N N is the minimum number of lines kept between the insertion point (indicated by the caret) and the bottom of the text subwindow.  (Synonym is −lower_context; overrides default Lower_context which has value 2.) 

−Em N N is the number of pixels by which the left edge of the text is offset from the scrollbar.  (Synonym is −margin; overrides default Left_margin which has value 4.) 

−ES N N is the number of pixels within which two clicks of a mouse button must occur in order to be considered a multi-click.  (Synonym is −multi_click_space; overrides default Multi_click_space which has value 3.) 

−ET N N is the number of milli-seconds within which two clicks of a mouse button must occur in order to be considered a multi-click.  (Synonym is −multi_click_timeout; overrides default Multi_click_timeout which has value 390.) 

−En N N is the number of lines in the bottom subwindow.  (Synonym is −number_of_lines; standard value is 45.) 

−Eo on|off (Synonym is −okay_to_overwrite; overrides default Store_self_is_save which has value False.) 

onA Store menu operation to the current file name is treated as a Save. 

offStore to the current file results in an error message and is aborted. 

−Er on|off If on, the text cannot be modified, only browsed.  (Synonym is −read_only, standard value is off.) 

−Es N N is the number of lines in the scratch window.  A zero value means that there is no scratch window.  (Synonym is −scratch_window; overrides default Scratch_window which has value 1.) 

−Et N N is the number of spaces that define a column when a TAB is displayed.  This option has no effect on the characters actually stored in the file being edited; it only affects their display.  (Synonym is −tab_width; overrides default Tab_width which has value 8.) 

−Eu N N is the number of editing sequences that can be undone or replayed.  (Synonym is −history_limit; overrides default History_limit which has value 50.) 

−EU N N is the minimum number of lines kept between the insertion point and the top of the text subwindow.  (Synonym is −upper_context; overrides default Upper_context which has value 2.) 

−Ec N N specifies the checkpoint frequency.  0 means that no checkpointing will take place.  For a value N greater than zero, checkpointing will take place after every nth edit.  Each character typed, each Get, and each Delete counts as an edit.  If the file being edited is named foo, at each checkpoint, an updated copy of the file will be saved in foo%%.  (Synonym is −checkpoint; overrides default Checkpoint_frequency which has value 0.) 

COMMANDS

Making a selection

In textedit the mouse is used to specify a selection, which is a character span to operate on.  The mouse is also used to position the insertion point and to invoke a menu of additional commands.  The assignment of commands to the mouse buttons is:

CommandMouse buttonDescription
Select Left Starts a new selection and moves the insertion
point to the end of the selection nearest the
mouse cursor.
 AdjustMiddle Extends a selection, and moves the insertion
point.
 MenuRightDisplays a menu of operations, explained below.

There are two types of selections: a primary selection is indicated by video-inversion of the span of characters, and tends to persist.  A secondary selection is indicated by underlining the span of characters and only exists while one of the four function keys corresponding to the commands Delete, Find, Get, or Put, is depressed. 

In addition, either type of selection can have the property of being pending-delete, indicated by overlaying the span of characters with a light gray pattern.  A selection is made pending-delete by holding the CONTROL key down while doing either a Select or an Adjust.  If a primary selection is pending-delete, it is only deleted when characters are inserted, either by type-in or by Get or Put.  If a secondary selection is pending-delete, it is deleted when the function key is released, except in the case of the Find command, which deselects the secondary selection.  Either the defaults entry Adjust_is_pending_delete or the −Ea command line option can be used to make either type of selection pending-delete whenever it is adjusted; in this case, holding the CONTROL key while doing an Adjust makes the selection not be pending-delete. 

Commands that operate upon the primary selection do so even if the primary selection is not in the window that issued the command. 

Inserting text and command characters

For the most part, typing any of the standard keys either causes the corresponding character to be inserted at the insertion point, or causes characters to be erased.  However, certain key combinations are treated as commands:

CommandCharacterDescription
Delete-PrimaryCTRL-DErases, and moves to the Shelf, the
primary selection.
Find-PrimaryCTRL-FSearches the text for the
pattern specified by the primary
selection or by the Shelf, if there is no
primary selection.
Get-ShelfCTRL-GCopies the Shelf to the insertion
point.
Put-then-GetCTRL-PAccelerator for Put then Get.
Go-to-EOFCTRL-RETURNMoves the insertion
point to the end of the text, positioning
the text so that the insertion point is visible.

Function Keys

The commands indicated by use of the function keys are:

CommandSun-2|3 KeyDescription
StopL1Aborts the current command.
AgainL2Repeats the previous editing sequence since a
primary selection was made.
UndoL4Undoes a prior editing sequence.
ExposeL5Makes the window completely visible (or
hides it, if it is already exposed).
PutL6Copies the primary selection, either to the
Shelf or at the closest end of the secondary
selection.
CloseL7Makes the window iconic (or normal, if it is already
iconic).
GetL8Copies either the secondary selection or the Shelf at
the insertion point.
FindL9Searches for the pattern specified by, in order, the
secondary selection, the primary selection, or the Shelf.
DeleteL10Erases, and moves to the Shelf, either the primary or
the secondary selection.
CAPSLOCKF1Forces all subsequently typed alphabetic characters
to be upper-case.
This key is a toggle; striking it a second time undoes the
effect of the first strike.

Find usually searches the text forwards, towards the end.  Holding down the SHIFT key while invoking Find causes the search to go backward through the text, towards the beginning.  If the pattern is not found before the search encounters either extreme, it "wraps around" and continues from the other extreme.  Find starts the search at the appropriate end of the primary selection, if the primary selection is in the subwindow that the search is made in; otherwise it starts at the insertion point, unless the subwindow cannot be edited, in which case it starts at the beginning of the text. 

If the default assignment of function keys to commands is inconvenient (or does not make sense, in the case of a Sun-1 keyboard), it can be modified by the setkeys(1) program. 

Menu Items

Commands that are available by use of the generic text subwindow menu are:

Menu ItemDescription
SaveA pull-right item, it is equivalent to Save file.
Save fileSaves the edits (requires that a file is being
edited).
Save & QuitIf the Save succeeds, textedit terminates.
Save & ResetIf the Save succeeds, textedit Resets.
Close & SaveMakes the window iconic and then does the Save.
Store to named fileStores the edits to the file specified
by the primary selection, and then continues editing that
file.
Store & QuitIf the Store succeeds, textedit
terminates.
Close & StoreMakes the window iconic and then does the Store
as described above.
Load filetextedit begins editing the file specified
by the primary selection.
Select line #Displays the line specified by the primary
selection,
interpreted as an integer (where 1, not 0, is the first line).
Split viewRequires a following mouse button click to indicate
where to divide the text subwindow, then it creates another view
on the same text.
Destroy viewDestroys the view over which the menu was invoked.
ResetDiscards all edits made to the text;
requesting confirmation first.  If there were no edits,
unloads the file if editing a file.
What line #?Displays a message indicating the line
number containing the start of the primary selection.
Get from fileCopies to the insertion point the contents of the
file specified by the primary selection.
Caret to topPositions the text in the view over which the
menu was invoked so that the insertion point is just below
the top of the view.
Line breakA pull-right item, it is equivalent to Clip lines.
Clip linesAny line that does not terminate in a newline before
encountering the right edge of the window is clipped at the right
edge.
Wrap at characterLong lines are displayed on multiple window lines.
Set directoryChanges the working directory to the directory name
specified by the primary selection.
FindA pull-right item, it is equivalent to Find, forward.
Find, forwardSearches for, in order, the primary selection or the
Shelf.
Find, backwardSearches for, in order, the primary selection or the
Shelf, but moving backward through the text.
Find Shelf, forwardSearches for the Shelf.
Find Shelf, backwardSearches for the Shelf, but moving backward
through the text.
Put then GetEquivalent to a Put followed by a Get.

Only those commands that are active appear normally in the menu; inactive commands, which are inappropriate at the time that the menu is invoked (such as Destroy view when there is only one view), are indicated by being "grayed out". 

User Defined Commands

The file ~/.textswrc specifies filter programs that are executed when unassigned function keys are depressed.  These filters are invoked with the contents of the primary selection available on their stdin, and output on their stdout is entered in the text being edited at the insertion point. 

An example file that contains filters useful for programming and documenting is available as /usr/lib/.textswrc.  This file can be copied and edited to re-bind filters to function keys according to individual preferences.  See Windows and Window-Based Tools: Beginner’s Guide for a specification of the format of the .textswrc and a list of filters and their descriptions. 

FILES

~/.textswrc specifies bindings of filters to function keys

/usr/bin contains useful filters, including shift_lines and capitalize. 

filename% prior version of filename is available here after a Save menu operation

textedit.pid edited version of filename; generated in response to fatal internal errors

/tmp/EtHost∗ editing session logs

SEE ALSO

defaultsedit(1), kill(1), setkeys(1), suntools(1)

Windows and Window-Based Tools: Beginner’s Guide

DIAGNOSTICS

Messages displayed by textedit during initialization (and their cause) are:

Cannot open file ’file’, aborting! 
file does not exist or cannot be read. 

The exit status codes produced are:

0 normal termination

1 standard SunView help message was printed

2 help message was requested and printed

3 abnormal termination in response to a signal, usually due to an internal error

4 abnormal termination during initialization, usually due to a missing file or running out of swap space. 

BUGS

Multi-click to change the current unit does not work for Adjust Selection. 

Handling of long lines is incorrect in certain scrolling situations. 

There is no way to replay any editing sequence except the most recent. 

Sun Release 3.2  —  Last change: 19 February 1986

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026