2021-10-11 18:20:23 -03:00

728 lines
15 KiB
Groff

.\" @(#)textedit.1 1.1 92/07/30 SMI;
.TH TEXTEDIT 1 "2 October 1989"
.SH NAME
textedit \- SunView window- and mouse-based text editor
.SH SYNOPSIS
.B textedit
[
.I generic-tool-arguments
]
[
.B "\-Ea on\|" |\| off
]
[
.B \-adjust_is_pending_delete
]
[
.B "\-Ei on\|" |\| off
]
.if t .ti +0.5i
[
.B \-auto_indent
]
[
.B "\-Eo on\|" |\| off
]
[
.B \-okay_to_overwrite
]
[
.B "\-Er on\|" |\| off
]
[
.B \-read_only
]
.if t .ti +0.5i
[
.BI \-Ec " N"
]
[
.BI \-checkpoint " count"
]
[
.BI \-\s-1EL\s0 " lines"
]
[
.BI \-lower_context " lines"
]
[
.BI \-Em " pixels"
]
.if t .ti +0.5i
[
.BI \-margin " pixels"
]
[
.BI \-En " N"
]
[
.BI \-number_of_lines " lines"
]
[
.BI \-Es " N"
]
[
.BI \-scratch_window " lines"
]
.if t .ti +0.5i
[
.BI \-\s-1ES\s0 " N"
]
[
.BI \-multi_click_space " radius"
]
[
.BI \-Et " N"
]
[
.BI \-tab_width " tabstop"
]
[
.BI \-\s-1ET\s0 " N"
]
.if t .ti +0.5i
[
.BI \-multi_click_timeout " intrvl"
]
[
.BI \-Eu " N"
]
[
.BI \-history_limit " max"
]
[
.BI \-\s-1EU\s0 " N"
]
.if t .ti +0.5i
[
.BI \-upper_context " lines"
]
.I filename
.SH AVAILABILITY
This command is available with the
.TX SVBG
software installation option. Refer to
.TX INSTALL
for information on how to install optional software.
.SH DESCRIPTION
.IX textedit "" "\fLtextedit\fR \(em SunView text editor"
.IX tools textedit "" "\fLtextedit\fR"
.LP
.B textedit
is a mouse-oriented text editor that runs within the
SunView environment.
It creates a window containing two text subwindows.
The top subwindow (referred to as the \*(lqscratch\*(rq window)
can be used to store small pieces of text.
The bottom subwindow (referred to as the \*(lqedit\*(rq
window) displays the contents of
.IR filename ,
if given.
.LP
The name of the file currently being edited
is displayed in the left-hand portion of the frame header.
The name of the current working directory
is displayed in the right-hand portion.
.
.SH OPTIONS
.LP
.TP 12
.I generic-tool-arguments
.B textedit
accepts the SunView generic tool arguments listed in
.BR sunview (1).
.
.TP
.BR "\-Ea on" \||\| off
.PD 0
.TP
.B \-adjust_is_pending_delete
.PD
Choose whether or not an adjustment to a selection makes the
selection \*(lqpending-delete.\*(rq The default is off.
This option corresponds to, and overrides, the
.B adjust_is_pending_delete
Text defaults entry.
.
.TP
.PD 0
.BR "\-Ei on" \||\| off
.TP
.B \-auto_indent
.PD
Choose whether or not to automatically indent newly-opened
lines. The default is off. Corresponds to the
.BR auto_indent
Text default.
.
.TP
.BR "\-Eo on" \||\| off
.PD 0
.TP
.B \-okay_to_overwrite
.PD
Set behavior to the
.B "Store as New File"
menu item. If
.B on
a
.B "Store as New File"
to the current file is treated as a
.BR "Save Current File" .
If
.BR off
(the standard default),
.B "Store as New File"
operations using the current filename
result in an error message.
Corresponds to
.BR Store_self_is_save .
.TP
.PD 0
.BR "\-Er on" \||\| off
.TP
.B \-read_only
.PD
Turn read-only mode on or off.
When on, text cannot be modified.
.
.TP
.BI \-Ec " N"
.PD 0
.TP
.BI \-checkpoint " count"
.PD
Checkpoint after every
.I count
editing operations.
If
.I count
is 0 (the standard default), no checkpointing takes place.
Each character typed, each
.BR Paste ,
and each
.B Cut
counts as an editing operation. Corresponds to
.BR checkpoint_frequency .
.
.br
.ne 7
.TP
.BI \-EL " lines"
.PD 0
.TP
.BI \-lower_context " lines"
.PD
Specify the minimum number of lines to keep between the caret
and the bottom of the text subwindow.
The default is 2.
Corresponds to
.BR lower_context .
.
.br
.ne 6
.TP
.BI \-Em " pixels"
.PD 0
.TP
.BI \-margin " pixels"
.PD
Set the scrollbar margin width in pixels.
The default is 4.
Corresponds to
.BR left_margin .
.
.TP
.BI \-En " N"
.PD 0
.TP
.BI \-number_of_lines " lines"
.PD
Set the number of lines in the bottom subwindow.
The default is 45.
.
.TP
.BI \-Es " N"
.PD 0
.TP
.BI \-scratch_window " lines"
.PD
Set the number of lines in the scratch window.
A zero value means that there is no scratch window.
The standard default is 1.
Corresponds to
.BR scratch_window .
.
.TP
.BI \-ES " N"
.PD 0
.TP
.BI \-multi_click_space " radius"
.PD
Set the radius, in pixels, within which clicks must
occur to be treated as a multi-click selection.
The default is 3 pixels.
Corresponds to
.BR multi_click_space .
.
.TP
.BI \-Et " N"
.PD 0
.TP
.BI \-tab_width " tabstop"
.PD
Set the number of
.SM SPACE
characters displayed per
.SM TAB
stop.
The default is 8.
This option has no effect on the characters in the file.
Corresponds to
.BR tab_width .
.
.TP
.BI \-ET " N"
.PD 0
.TP
.BI \-multi_click_timeout " intrvl"
.PD
Set the interval, in milliseconds,
within which any two clicks must occur to be treated as a
multi-click selection.
The default is 390 milliseconds.
Corresponds to
.BR multi_click_timeout .
.TP
.BI \-Eu " N"
.PD 0
.TP
.BI \-history_limit " max"
.PD
Set the maximum number of editing operations that can be
undone or replayed.
The default is 50.
Corresponds to
.BR history_limit .
.
.TP
.B \-EU " N"
.PD 0
.TP
.BI \-upper_context " lines"
.PD
Set the minimum number of lines to keep between the caret and
the top of the text subwindow.
The default is 2.
Corresponds to
.BR upper_context .
.
.SH USAGE
For a description of how to use the facilities of the
text subwindows, see the
.TX SVBG .
.SS Signal Processing
.LP
If
.B textedit
hangs, for whatever reason, you can send a
.SB SIGHUP
signal to its process
.SM ID\s0,
which forces it to write any changes
(if possible):
.IP
.BI "kill \-\s-1HUP\s0 " pid
.br
.ne 5
.LP
The edits are written to the file
.BI textedit. pid
in its working directory.
If that fails,
.B textedit
successively tries to write to a file by that name in
.BR /var/tmp ,
and then
.BR /tmp .
In addition, whenever
.B textedit
catches a fatal signal, such as
.BR \s-1SIGILL\s0 ,
it tries to write out the edits before aborting.
.br
.ne 10
.SS Defaults Options
.LP
There are several dozen user-specified defaults that affect
the behavior of the text-based facilities. See
.BR defaultsedit (1)
for a complete description.
Important defaults entries in the
.B Text
category are:
.TP 18
.B Edit_back_char
Set the character for erasing to the left of the caret.
The standard default is
\fB\s-1DELETE\s0\fP.
Note: the tty erase character-setting has no effect on
.BR textedit .
Text-based tools refer only to the defaults database key
settings.
.TP
.B Edit_back_word
Set the character for erasing the word to the left of the
caret.
The standard default is
\s-1CTRL-W\s0.
.br
.ne 5
.TP
.B Edit_back_line
Set the character for erasing all characters to the left of the
caret.
The standard default is
\s-1CTRL-U\s0.
.TP
.B Checkpoint_frequency
If set to
.B 0
(the standard default) no checkpointing is done.
For any value greater than zero,
a checkpoint is made each time the indicated number of
editing operations has been performed since the last checkpoint.
Each character typed, each
.BR Paste ,
and each
.B Cut
counts as an editing operation.
The checkpoint file has a name of the form:
.IB filename %%\fR,
where
.I filename
is the name of the file being edited.
.SS Making a selection
.LP
In
.BR 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 commands.
.LP
The assignment of commands to the mouse buttons is:
.RS
.TP 20
.B Mouse button
.B Description
.TP
.SM LEFT
Starts a new selection and moves the insertion
point to the end of the selection nearest the
mouse cursor.
.TP
.SM MIDDLE
Extends a selection, and moves the insertion
point.
.TP
.SM RIGHT
Displays a menu of operations, explained below.
.RE
.LP
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
.BR Cut ,
.BR Find ,
.BR Paste ,
or
.BR Copy ,
is depressed.
.LP
In addition, a selection can be \*(lqpending-delete,\*(rq as indicated
by overlaying the span of characters with a light gray pattern.
A selection is made pending-delete by holding the
.SM CTRL
key while clicking the
.SM LEFT
or
.SM MIDDLE
mouse buttons.
If a primary selection is pending-delete, it is only deleted when
characters are inserted, either by type-in or by
.B Paste
or
.BR Copy .
If a secondary selection is pending-delete,
it is deleted when the function key is released, except in the case
of the
.BR Find ,
which deselects the secondary selection.
.LP
You can make adjusted selections switch to pending-delete using the
.B adjust_is_pending_delete
defaults entry, or the
.B \-Ea
option.
In this case,
\s-1CTRL\s0-Middle
makes the selection
.I not
pending-delete.
.LP
Commands that operate on the primary selection do so even if the
primary selection is not in the window that issued the command.
.br
.ne 18
.SS "Inserting Text and Command Characters"
.LP
For the most part, typing any of the standard
keys either inserts the corresponding character
at the insertion point, or erases characters.
However, certain key combinations are treated as commands.
.\"A complete list can be found in
.\".BR sunview (5).
Some of the most useful are:
.LP
.ta 20n 40n
.nf
.B Command Character Description
.sp
\fBCut-Primary\fR \s-1META\s0-X Erases, and moves to the Clipboard, the primary selection.
\fBFind-Primary\fR \s-1META\s0-F Searches the text for the pattern specified by the primary
selection or by the Clipboard, if there is no primary selection.
\fBCopy-to-Clipboard\fR \s-1META\s0-C Copies the primary selection to the Clipboard.
\fBPaste-Clipboard\fR \s-1META\s0-V Inserts the Clipboard contents at the insertion point.
\fBCopy-then-Paste\fR \s-1META\s0-P Copies the primary selection to the insertion point (through
the Clipboard).
\fBGo-to-\s-1EOF\s0\fR \s-1CTRL\s0-\s-1RETURN\s0 Moves the insertion point to the end of the text, positioning
the text so that the insertion point is visible.
.fi
.br
.ne 8
.SS Function Keys
.LP
The commands indicated by use of the function keys are:
.LP
.ta 20n 40n
.nf
\fBCommand\fP \fBSun-2\||\|3 Key\fP \fBDescription\fP
.sp
\fBStop\fR L1 Aborts the current command.
\fBAgain\fR L2 Repeats the previous editing sequence since a
primary selection was made.
\fBUndo\fR L4 Undoes a prior editing sequence.
\fBFront\fR L5 Makes the window completely visible (or
hides it, if it is already exposed).
\fBCopy\fR L6 Copies the primary selection, either to the
Clipboard or at the closest end of the secondary
selection.
\fBOpen\fR L7 Makes the window iconic (or normal, if it is already
iconic).
\fBPaste\fR L8 Copies either the secondary selection or the Clipboard at
the insertion point.
\fBFind\fR L9 Searches for the pattern specified by, in order, the
secondary selection, the primary selection, or the Clipboard.
\fBCut\fR L10 Erases, and moves to the Clipboard, either the primary or
the secondary selection.
\fB\s-1CAPSLOCK\s0\fR F1 Forces 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.
.fi
.LP
.B Find
usually searches the text forwards, towards the end.
Holding down the
.SM SHIFT
key while invoking
.B Find
searches backward through the text, towards the beginning.
If the pattern is not found before the search encounters
either extreme, it \*(lqwraps around\*(rq and
continues from the other extreme.
.B 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.
.LP
\s-1CTRL\s0-Find
invokes the
.B Find and Replace
pop-up frame.
.LP
The default assignment of function keys can be modified using
.BR defaultsedit (1).
.br
.ne 18
.SS Menu Items
.LP
.TP 10
.B File
A pull-right menu item for file operations.
.TP
.B Edit
A pull-right menu item equivalent of the editing function keys.
The
.B Edit
submenu provides
.BR Again ,
.BR Undo ,
.BR Copy ,
.BR Paste ,
and
.B Cut
(same as function keys L2, L4, L6, L8, and L10).
.TP
.B Display
A pull-right menu item for controlling the way
text is displayed and line display format.
.TP
.B Find
A pull-right menu item for find and delimiter matching operations.
.TP
.B Extras
A user definable pull-right menu item. The
.B Extras
standard submenu is controlled by
.BR /usr/lib/text_extras_menu .
This file has the same syntax as
.B \&.rootmenu
file.
See
.BR sunview (1).
.LP
Only those items that are active appear as normal text in the menu;
inactive items (which are inappropriate at the time) are \*(lqgrayed out\*(rq.
.SS User Defined Commands
.LP
The file
.B /usr/lib/text_extras_menu
specifies filter programs that are included in the text subwindow
.B Extras
pull-right menu item.
The file
.B ~/.textswrc
specifies filter programs that are assigned to (available)
function keys.
These filters are applied to the contents of the primary selection.
Their output is entered at the caret.
.LP
The file
.B /usr/lib/textswrc
is a sample containing a set of useful filters.
It is not read automatically.
.SH ENVIRONMENT
.LP
The environment variables
.BR \s-1LC_CTYPE\s0 ,
.BR \s-1LANG\s0 ,
and
.B \s-1LC\s0_default
control the character classification
throughout
.BR textedit .
On entry to
.BR textedit ,
these environment variables are checked in the
following order:
.BR \s-1LC_CTYPE\s0 ,
.BR \s-1LANG\s0 ,
and
.BR \s-1LC\s0_default.
When a valid value is found,
remaining environment variables for character classification
are ignored.
For example, a new setting for
.B \s-1LANG\s0
does not override the current valid character
classification rules of
.BR \s-1LC_CTYPE\s0 .
When none of the values is valid,
the shell character
classification defaults to the
.SM POSIX.1 \*(lqC\*(rq
locale.
.SH FILES
.PD 0
.TP 25
.B ~/.textswrc
specifies bindings of filters to function keys
.TP
.B /usr/lib/text_extras_menu
specifies bindings of filters for the extras menu pull-right items
.TP
.B /usr/bin
contains useful filters, including \fBshift_lines\fP and \fBcapitalize\fP.
.TP
.IB filename %
prior version of
.I filename
is available here after a
.B Save Current File
menu operation
.TP
.BI textedit. pid
edited version of
.IR filename ;
generated in response to fatal internal errors
.TP
.B /tmp/Text*
editing session logs
.PD
.SH "SEE ALSO"
.BR defaultsedit (1),
.BR kill (1),
.BR sunview (1)
.\".BR sunview (5),
.\".BR textswrc (5)
.LP
.TX SVBG
.SH DIAGNOSTICS
.TP 35
.B "Cannot open file '\fIfilename\fP', aborting!"
.I filename
does not exist or cannot be read.
.LP
.B textedit
produces the following exit status codes:
.LP
.PD 0
.RS
.TP
0
normal termination
.TP
1
standard SunView help message was printed
.TP
2
help message was requested and printed
.TP
3
abnormal termination in response to a signal, usually due to an internal error
.TP
4
abnormal termination during initialization,
usually due to a missing file or running out of swap space
.PD
.RE
.br
.ne 9
.SH BUGS
Multi-click to change the current selection does not work for
.BR "Adjust Selection" .
.LP
Handling of long lines is incorrect in certain scrolling situations.
.LP
There is no way to replay any editing sequence except the most recent.
.LP
.RB ` "textedit\fI newfile\fP" '
fails if
.I newfile
does not exist.