tvx: 9 of 10

sources-request at panda.UUCP sources-request at panda.UUCP
Tue Mar 11 12:00:22 AEST 1986


Mod.sources:  Volume 4, Issue 23
Submitted by: gatech!unmvax!wampler (Bruce Wampler)

#--------CUT---------CUT---------CUT---------CUT--------#
#########################################################
#  TVX: File 9 of 10                                    #
#                                                       #
# This is a shell archive file.  To extract files:      #
#                                                       #
#    1)	Make a directory (like tvx) for the files.      #
#    2) Write a file, such as "filen.shar", containing  #
#       this archive file into the directory.           #
#    3) Type "sh file.shar".  Do not use csh.           #
#                                                       #
#########################################################
#
#
echo Extracting tvx_ref1.doc:
sed 's/^X//' >tvx_ref1.doc <<\SHAR_EOF
X
X
X
X
X
X                         TVX Reference Manual
X 
X 
X 
X     This is the Reference Manual for TVX, a full screen
Xeditor written in C by Dr. Bruce E. Wampler.  (Current address: Dr.
XBruce E. Wampler, University of New Mexico, Department of Computer
XScience, Farris Engineering Center, Albuquerque, NM 87131; uucp:
X...{ucbvax | gatech | ihnp4!lanl}!unmvax!wampler).  Any comments, bug
Xreports, or suggestions should be sent to that address.  The name TVX
Xis derived from "TV" editor for any terminal ("X"). 
X 
X     The current release of TVX has several different versions:
X 
X1) Standard TVX - The original version and command set of TVX. 
X2) VIX - A version of TVX that emulates the Unix vi editor. 
X3) TVX0 - A modeless version of TVX. 
X4) EMAX - A version of TVX that emulates the EMACS editor. 
X 
X     The main part of this manual is written describing "Standard
XTVX," the version used by the author.  The VIX, TVX0, and EMAX
Xversions are described in appendices.  While the emulator versions of
XTVX are close command set compatible versions of the original editors,
Xthe you should be aware that certain fundamental properties of the
Xunderlying TVX editor remain, and that the emulators will not work
Xexactly like the originals.  If you intend to use one of the other
Xversions of TVX, you should read this part of the manual up to the
Xsection describing standard TVX commands first. 
X 
X 
X*** General Comments ***
X 
X     Standard TVX functions almost identically for all versions,
Xincluding the command set.  The emulation versions of TVX have been
Xwritten to be command set compatible with the original versions of the
Xeditors.  It is also possible to construct a completely new version of
XTVX with a custom command set.  Control codes on are normally entered
Xby pressing the CTRL key and the letter key at the same time.  On most
Xversions, the character delete key is BACKSPACE.  This character
Xdelete key is the one normally used by the respective operating
Xsystem.  It is up to the local implementation to notify the user of
Xany variance from these conventions. 
X 
X     Once the file has been read in, the screen will be cleared, and
Xthe first screenful of the file printed on the screen and the cursor
Xpositioned over the first character of the file.  If a new file is
Xbeing created, the message "buffer empty" will be displayed, and the
Xcursor positioned in the upper left corner.  TVX is then ready to
Xaccept commands from the keyboard.  TVX works on the principle that
Xwhat you see is what you get.  Most commands also take an optional
Xnumeric count.  The default count is always one.  Commands that allow
Xa count value are preceded by the letter 'n' in the following
Xdescriptions.  Whenever a command produces output or an error message,
Xit appears on the bottom line of the screen. 
X 
X     The BACKSPACE key (Control-H on some terminals) is used to edit
X 
X 
X                                 -1-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xinput text.  When TVX is accepting commands, BACKSPACE will cause the
Xcharacter immediately before the cursor to be deleted. 
X 
X     TVX (all versions!) works entirely in the available memory for
Xediting.  The text from the file which is being edited is held in a
Xbuffer in main memory.  If a file is particularly large, it may not
Xentirely fit into main memory.  The MS-DOS versions, for example, will
Xallow about 50K characters, depending on the memory available.  Unix
Xversions will usually allow 120,000 characters and 5000 lines in one
Xbuffer.  If the entire file will not fit into the buffer at once, then
Xonly part of it is read in at a time.  The buffer size limit in no way
Xrestricts the total size of a file that can be edited by TVX.  To make
Xediting large files easier, some commands apply to the entire file and
Xcause automatic cross buffer manipulation. 
X 
X     Because of the internal organization of the text within the
Xbuffer, TVX may occasionally "compact" the tiny fragments of unused
Xbuffer space generated as a part of normal editing.  When this
Xhappens, a message is displayed, and input keystrokes are remembered
Xbut not echoed until the compaction process is complete.  The process
Xmay take several seconds. 
X 
X     TVX actually divides the internal memory into two parts: the text
Xbuffer and the save buffer.  The text buffer (or simply the buffer) is
Xused to hold the file (or part of the file) being edited.  There is
Xonly one such text buffer (unlike some other editors such as emacs).
XThe save buffer is used for moving text, both from one part of the
Xtext buffer to the other, as well as to and from external files.  The
Xmaximum size of the save buffer depends on the amount of text
Xcurrently residing in the main text buffer.  The following diagram
Xshows the internal TVX memory organization:
X 
X   +-----------------------------+
X   |  TEXT BUFFER - the current  |
X   |  text (or portion) of file  |
X   |  being edited. (grows down) |
X   |            _________________|
X   |___________|                 |
X   |  free memory        ________|
X   |_____________________|       |
X   |  SAVE BUFFER - grows up     |
X   +-----------------------------+
X 
X     Text is added to the text buffer when the file is first read in
X(or created).  If the file doesn't fit into one buffer, you will have
Xto manually "page" the text into the buffer.  Text is added to the
Xsave buffer in one of several ways.  TVX (and emulators) have commands
Xto move text from the text buffer to the save buffer, and move the
Xcontents of the save buffer to the text buffer.  TVX also has "cut
Xmode".  When cut mode is enabled, when lines are killed, they are
Xautomatically copied into the save buffer as well as being deleted
Xfrom the text buffer.  Cut mode is normally off for TVX, but is on for
XVIX and EMAX.  It is also possible to save the contents of the save
Xbuffer to a new external file, and to load the save buffer from an
Xexternal file.  All versions of TVX use this scheme for handling
Xtext. 
X 
X 
X                                 -2-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
X     End of lines are not special to TVX.  Thus all the cursor
Xmovement commands and delete single character commands will treat the
Xend of line as just another character.  This also means that a
X<Return> (end of line) is a valid search character, and thus makes it
Ximpossible to end a find pattern with a <Return>.  The <Escape> key is
Xused to mark the end of a find pattern.  All the Standard TVX wild
Xcards may be used for all versions of TVX. 
X 
X     Another basic concept of TVX is the "last thing." Whenever TVX
Xfinds a pattern from the search command, skips over a word, or gets
Xfrom or puts to the save buffer, that text is considered the "last
Xthing." All versions of TVX will have a command that can delete the
Xlast thing.  While this is this a powerful editing concept, it does
Xhave some consequences.  First, the cursor will always be placed AFTER
Xthe pattern just found.  It also means that TVX has no delete word
Xcommands.  Instead, the delete last thing command is used after
Xskipping over a word.  Using the delete last thing also makes it very
Xeasy to save text into the save buffer, and then deleting it after the
Xdesired number of lines have been saved. 
X 
X     Probably the most powerful editing tool provided by TVX is the
Xrepeat loop.  This allows arbitrary command sequences to be entered,
Xand repeated any number of times.  All versions of TVX will have at
Xleast 5 different repeat buffers.  All emulation versions of TVX use
Xthe basic TVX repeat loop instead of emulating whatever macro facility
Xmight be provided by the orignal editor.  (The commands inside the
Xrepeat loop are the emulated commands, not standard TVX commands.)
X 
X     Many of the basic operating characteristics of TVX are
Xcontrollable by user settable parameters.  These parameters are
Xrelevant to all versions of TVX, with the current status of each
Xdisplayed on the help screen.  These parameters are summarized in the
X'set parameter' command (':') in the Standard TVX Commands section,
Xbut a brief overview of the paramaters will also cover some of the
Xcapabilities of TVX (and the emulator versions). 
X 
X     While the normal screen is only 80 columns wide, TVX has been
Xwritten to support a "virtual" screen width of 240 columns.  As you
Xmove the cursor right on a line that is longer than 80 columns, the
Xscreen will automatically scroll to the left in increments of 16
Xcolumns.  You can also control how many lines of the screen TVX uses
Xusing the 'v' parameter.  Normally, TVX will use the entire screen.
XIf you are working over phone lines, you can tell TVX to use only 5 or
X7 lines, thus making updating much faster. 
X 
X     TVX has some limited word processing cabability.  This is the
Xautowrap feature, settable both when you first run TVX, and by the 'w'
Xparameter.  Setting autowrap to column 65, for example, will tell TVX
Xto automatically insert a newline whenever you enter text past that
Xcolumn.  The 'tidy' command will use the autowrap margin to 'fill' the
Xtext after the fact.  This feature makes it easy to make your text
Xmore readable, and even create good looking short memos without
Xneeding to resort to nroff or troff. 
X 
X     For programmers, TVX has an autowrap command.  The 'a' parameter
Xcontrols this feature.  When enabled, TVX will automatically match the
X 
X 
X                                 -3-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xleading white space at the beginning of the previous line. 
X 
X     The search command also has some advanced features.  By default,
Xsearches are case insensitive, but the 'f' parameter controls this.
XTVX also supports a set of "wild cards".  You can specify a set of
Xletters, numbers, alphanumerics, punctuation, or other characters as
Xpart of the wild cards.  The 'u' parameter also allows you to define
Xyour own set of wild card characters.  TVX remembers the last pattern
Xfound (the actual pattern, not just the wild cards), and has a command
Xto insert that pattern into the text.  Thus, with repeat loops, wild
Xcards, and the insert found pattern command, it is possible to do
Xquite creative editing functions.  The 'm' parameter controls the use
Xof wild card matching, so it can be disabled if you need to match one
Xof the wild card characters. 
X 
X     Finally, TVX has parameters to control just how the screen is
Xscrolled.  The home display line controlled by the 'd' parameter tells
XTVX which line to put the cursor on when the screen has been
X'verified'.  The 's' scroll window controls how many lines the cursor
Xwill move up and down from the home line before scrolling the text.
XIf the scroll window is 0, then the cursor will be fixed on the home
Xdisplay line.  By setting it to another value, you can control how
Xmuch context remains before scrolling.  These settings are very much
Xpersonal taste. 
X 
X     TVX uses two techniques for protecting the original file from
Xediting mistakes.  First, each time a file is edited, a new version is
Xcreated, and the previous version retained in its original form as a
Xbackup.  This file will change the original file extension to '.BAK'
Xon MS-DOS systems, and '.B' on Unix.  A more complete description of
XTVX file handling is included in an appendix.  Also, as you edit your
Xfile, TVX has the capability to write all commands entered during the
Xsession to a log file when that capability is enabled.  In the event
Xof a major editing mistake, it is possible to edit that log file to
Xremove the command errors, and then apply that "command" file to the
Xprevious version of the edited file to get back to the state right
Xbefore the mistake.  This feature also allows files of TVX commands to
Xbe defined by the user and executed in one step.  The last section of
Xthe Reference Manual explains how to use the command file feature. 
X 
X 
X 
X*** RUNNING THE EDITOR ***
X 
X     To edit a file using TVX, enter the following command line:
X
X          tvx filename -switch1 -switch2 ...
X 
X     (VIX, EMAX, and TVX0 use the SAME command line format and
Xswitches.) The file name specified is the file to be edited, and must
Xobey the conventions used by the local operating system (the MS-DOS
Xversion requires DOS version 2.0, and supports pathnames).  If the
Xfile is a new file (does not exist), TVX will ask if you really want
Xto create it.  Answer y or n. If you gave an incorrect name, you may
Xgive the correct name, but the switches entered on the original start
Xline will remain in effect.  Control-C can be used at this point to
X 
X 
X                                 -4-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xabort. 
X 
X     TVX has several switches which control certain operating
Xcharacteristics.  Each switch begins with a minus (-), and is
Xseparated from the file name and other switches by a blank in the
Xstandard UNIX/C convention.  Some switches may be negated by using a
X'nox' form.  Thus, '-b' will cause a .bak file to be generated, while
Xa '-nob' causes the .bak file to be deleted on exit from the editor.
XThis capability is indicated by []'s.  As many switches as necessary
Xor desired can be used at one time in any order.  A ':' may be used
Xinstead of a '=' for '-c' and '-o'.  The various switches supported
Xinclude:
X 
X     -c=filename -- read a configuration file.  If only -c is
X          specified, TVX will look for file called /bin/CONFIG.TVX on
X          MS-DOS, for example.  The -c switch is not supported on all
X          implementations. 
X     -[no]b -- generate a .B[AK] version of the original (the usual
X          default).  The -nob option means no .BAK file is generated.
X          This latter mode of operation follows the normal Unix
X          convention of not keeping past generations of a file. 
X     -[no]i -- auto indent mode enabled. 
X     -[no]l -- generate BACKUP.LOG file
X     -o=filename -- send edited output to filename.  The output file
X          can also be changed at any time during the editing session
X          with the ':o' command. 
X     -r -- read only - file can be read in only
X     -s -- big save buffer - leaves more buffer for save file
X     -t -- tty mode - puts TVX into tty mode, not using the screen.
X          See the special appendix on tty mode.  (This is supported
X          only by two mode versions of TVX.)
X     -w -- word processing mode - sets autowrap on, margin to 65. 
X     -z -- -z means use Control-Z to mark end of file, -noz means
X          don't use.  This switch is used only on MS-DOS
X          implementations. 
X     -# -- entering a number from 3 up to the number of lines on the
X          screen will create a smaller TVX editing window.  This is
X          most useful for slower baud rates.  A -7 makes a nice, small
X          window showing 7 lines. 
X 
X     TVX is mostly a programmer's editor, and can can edit any
Xstandard text line file.  On Unix systems, it is an alternative to
Xstandard editors such as ed or vi. 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X                                 -5-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
X               *** Summary of Standard TVX Commands ***
X 
X 
X 
X     A key to success when using TVX is to remember that there are two
Xmodes of operation.  The normal mode is command mode.  In this mode,
Xall keystrokes are interpreted as commands.  When you want to enter
Xtext, you must enter insert mode with the 'I' command.  While in
Xinsert mode, all keystrokes entered will be inserted into the file and
Xdisplayed on the screen.  You must exit from insert mode with the
Xescape key.  When you enter insert mode, the message "### Insert Mode
X###" will be displayed on the last line of the display.  Also, on many
Xterminals, TVX will change the cursor shape between command and insert
Xmode. 
X 
X     The modeless version of TVX (TVX0) uses the same mnemonics as
XStandard TVX for the most part.  There is a 1:1 mapping between the
Xcommands.  The modeless names for each command is included in each
Xdescription of Standard TVX commands.  Counts for any modeless TVX
Xcommand can be entered after the escape.  Thus, "<Esc>10K" will kill
Xten lines, while <Esc>10^K" will kill 10 characters. 
X 
X     Notes: An n preceding a command means optional numeric
X     argument may be supplied.  If omitted n will default to 1,
X     and n can be zero or negative if appropriate.  '$'
X     represents the escape key, and is used as a terminator for
X     insert, find, and loops.  Control commands are indicated
X     with '^'.  For example, '^K' represents Control-K, and is
X     usually entered by simultaneously holding down the CTRL key
X     and the K key. 
X 
X 
XnA - Append to Save Buffer
X 
X     The 'A' command is used to append lines of text to the end of the
Xsave buffer, even if other commands have been used since the last 'A'
Xor 'S' command.  The append command works exactly like the 'S' command
Xotherwise. 
X 
X 
XB - Buffer beginning {TVX0: ^B}
X 
X     A 'B' causes the cursor to be moved to the beginning of the
Xcurrent buffer. 
X 
X 
X^B - Beginning of file {<Esc>B}
X 
X     The '^B' (Control-B) command is used to position the cursor to
Xthe absolute beginning of the file.  The '^B' command will always
Xwrite out the rest of the file, then re-read the first buffer full.
XThis command has the side effect of making a new backup version of the
Xfile.  It should be noted that any text saved in the save buffer will
Xbe preserved during this operation, so that the 'S' save command can
Xbe used to move text from the end to the beginning of a multi-buffer
Xfile.  The search pattern and repeat loops are retained as well.  Note
X 
X 
X                                 -6-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xthe '^B' file beginning is similar in concept to 'B' buffer
Xbeginning. 
X 
X 
XnC - Change {^C}
X 
X     'C' can be used to change characters.  Entering 'nC' is exactly
Xequivalent to entering 'nKI'.  The command will cause 'n' characters
Xto be killed, and insert mode to be entered.  The escape must be used
Xto terminate the insert as usual. 
X 
X 
XnD - Down {^D}
X 
X     'D' moves the cursor down n lines.  The cursor is placed at the
Xbeginning of the new line.  For convenience, the ENTER key performs
Xthe identical function. 
X 
X 
Xn^D - Down in column {<Esc>D}
X 
X     Control-D ('^D') is similar to 'D', except the cursor remains in
Xthe original column.  Columns are defined as characters from the
Xbeginning of the line, so if a line has tab characters in it, the
Xcursor may appear to move out of column on the screen. 
X 
X 
XE - End of the buffer {^E}
X 
X     'E' causes the cursor to be placed at the end of the current text
Xbuffer. 
X 
X 
Xn^E - Edit repeat buffer n {<Esc>E}
X 
X     When making repeat loops, it is easy to make a mistake.  The ^E
Xcommand allows any of the repeat buffers to be edited, and then the ^R
Xcommand can save the corrected repeat buffer back.  If you don't give
Xa value for n, the currently selected buffer is used.  If n is from 1
Xto the maximum number of repeat buffers, then that repeat buffer will
Xbe selected for editing. 
X 
X     The ^E command will insert the contents of the selected repeat
Xbuffer into the current text buffer.  The repeat buffer will be
Xinserted above the current text line.  The repeat buffer will start
Xwith a sequence of '#n:<', where n will be replaced by the repeat
Xbuffer being edited.  The '#n:' identifies which buffer you are
Xediting, and is used by the ^R store repeat buffer command to identify
Xthe buffer to save to.  Escapes will be represented by '^[' instead of
Xthe '$' used when entering a repeat buffer initially.  A '>^[^['
Xidentifies the end of the repeat loop. 
X 
X     It is possible to make as many changes as needed to the repeat
Xloop.  Escapes can be added by using '27i'.  If you want to save the
Xloop in a different buffer, you can change the number after the '#'.
XIt is also important to maintain the '#n:<' start and '>^[^[' ending
X 
X 
X                                 -7-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xsequences.  Also, loops are limited to a maximum of 100 characters.
XYou can have carriage returns within the body of a loop, too.  If you
Xwant to create a new buffer, you can use ^E on an empty repeat buffer
Xto get the required '#n:<>^[^[' loop sequence. 
X 
X     After you have edited the repeat buffer, it can be saved with the
X'^R' command.  You must place the cursor anywhere on the first line of
Xthe repeat buffer before using '^R'.  When you press ^R, the buffer
Xwill be saved in the buffer indicated right after the '#'.  Thus,
Xunlike ^E, the ^R command accepts no n value. 
X 
X 
XnF - Find text pattern {^F}
X 
X     'F' is used to find a text pattern.  When 'F' is entered, the
Xmessage 'Find?' is echoed on the bottom line.  You then enter the
Xpattern to find, terminated with the escape key (echoed as $).  When
Xthe count 'n' is positive (which is the default), find searches the
Xcurrent buffer from the current position forward.  If 'n' is negative,
Xthen a backwards search is performed starting with the previous line.
X(Use '^F' to search across buffers).  Normally, 'F' ignores the case
Xof the letters in the pattern.  If the ':F' parameter is set with 0,
Xthen 'F' command will match only the exact case.  See the ':' set
Xparameter command for details of the ':F' parameter.  If the pattern
Xis not found, "Not found" will be printed and the cursor remain at its
Xoriginal location.  If the pattern is found, then the cursor will be
Xplaced immediately following the pattern.  The pattern may be at most
X100 characters long.  If the pattern is only an escape, then the
Xprevious pattern will be used again (same as ';'). 
X     TVX supports extensive wild card matching.  The ':M' set
Xparameter controls whether or not wild card matching is turned on.
XNormally, it is.  The wild card matching in TVX is based on the
Xconcept of 'sets of special characters'.  TVX predefines 6 sets of
Xcharacters, and allows the user to define one additional set.  When a
Xspecial control character is included as part of the find pattern,
Xthen any character in the specified set will match the pattern.  The
Xpredefined sets are:
X
X    ^A - Alphanumeric characters: a-z, 0-9
X    ^D - Digits: 0-9
X    ^L - Letters: a-z
X    ^O - Other characters: all characters except a-z, 0-9
X    ^P - Punctuation: '.', ',', '!', '?'
X    ^X - Any character: any printable character
X    ^U - User character: any character in user set, set by ':U'
X
X     Any of the sets may be specified by entering the proper control
Xcharacter in the find pattern: Control-A for the ^A set.  Thus,
Xentering a find pattern of '^L^D' would match any letter followed by
Xany digit.  Since it may be desirable to match a sequence of one of
Xthe character sets, two prefix characters are supported.  A '^W'
Xbefore one of the above sets will match a 'word' of that set.  Thus,
X'^W^L' will match any word, and '^N^D' will match any number.  The
Xfind pattern 'st^W^L' would match words starting with 'st'.  The '^N'
Xprefix is used to make a 'word' of characters NOT included in the
Xgiven set.  Thus, '^N^L' will match a 'word' of characters NOT
X 
X 
X                                 -8-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xincluding the letters a-z.  A match 'word' consists of any sequence of
Xcharacters (at least one character long) found in the given set, up to
Xthe first character not in the set.  End of lines also terminate all
Xwild card patterns.  The only real way to adequately understand TVX
Xwild cards is to use them in practice. 
X 
X 
X^F- Find across buffers {<Esc>F}
X 
X     '^F' (Control-F) is the same as Find, except the search will
Xcross buffer boundaries.  Whenever a buffer is searched without
Xfinding the pattern, the next buffer will be read in.  The screen will
Xnot change until the pattern is found or the file is exhausted.  If
Xthe pattern is not found anywhere, then the entire file will have been
Xwritten out, and there will be an empty buffer.  The '^B' command may
Xbe used at that point to get back to the beginning of the file. 
X 
X 
XG - Get saved text {<Esc>G}
X 
X     'G' is used with 'S' and '^Y' to move text around.  'G' causes
Xthe text in the save buffer to be inserted before the current cursor
Xposition.  The saved text remains in the save buffer.  There must be
Xat least one line of text in the main buffer before 'G' will get the
Xtext from the save buffer. 
X 
X 
X^G - Get killed line (unkill) {^G}
X 
X     The '^G' (Control-G) unkill command can be used to "unkill" one
Xline, which will be the last line killed with '^K'.  If the last
Xcommand was 10^K (kill 10 lines), then '^G' will retrieve only the
Xlast line killed.  The "unkilled" line will be inserted right before
Xthe current cursor position.  It is also possible to move single lines
Xaround the text buffer using '^K' and '^G' - but be cautious.  Any
Xother '^K' command will reset the last killed line.  '^G' can also be
Xused to retrieve the entire line involved in a "'" (single quote) or
X'"' (double quote) command. 
X 
X 
XnH - Half page {<Esc>H}
X 
X     'H' is similar to the 'P' Page command.  It causes the cursor to
Xmove down a half screenful.  This will be typically be 12 lines.  A
Xnegative count (e.g.  -h) moves up a half screen. 
X 
X 
XnI - Insert {<Esc>I}
X 
X     'I' causes the editor leave command mode and enter insert mode.
XFollowing the 'I', all text typed in is inserted into the file until a
Xterminating escape is typed.  Inserted text is echoed on the screen as
Xit is inserted.  If any value is supplied for n (the default no n is
Xnot used), then only one character is inserted, and it will have the
Xascii value of n. This is the method used to enter characters that
Xcannot normally be entered in insert mode, such as escape or
X 
X 
X                                 -9-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xcharacters not on the keyboard.  The message "### Insert Mode ###" is
Xdisplayed on the bottom line when insert mode is entered (except when
Xinserting on the very last line of the file).  Many versions of TVX
Xwill change the shape of the cursor when insert mode is entered.
X{Insert is useful in the modeless version of TVX for entering either
Xsingle characters (<Esc>nI), or when several control characters will
Xbe entered (e.g., ^L).}
X 
X 
XJ - Jump back {<Esc>J}
X 
X     The 'J' command will cause a "jump" back to the line of the
Xprevious cursor position.  Suppose the cursor was positioned somewhere
Xin the middle of the file.  If the 'E' end command was entered, the
Xcursor would move to the end of the current buffer.  If the 'J'
Xcommand was then used, the cursor would return to the original line.
XIt makes it convenient to flip back and forth between two points in
Xthe file.  It is also useful if a large cursor movement command is
Xaccidentally entered (like when you thought you were in insert mode). 
X 
X 
XnK - Kill Character forward {^K}
X 
X     The 'K' command kills or deletes characters in a forward
Xdirection.  '1K' would delete the character the cursor is positioned
Xover, and '5K' would delete the next 5 characters. 
X 
X 
Xn^K - Kill lines {<Esc>K}
X 
X     '^K' (Control-K) is used to kill an entire line.  n=1 kills the
Xcurrent line, negative n kills previous lines, while positive n kills
Xfollowing lines. 
X 
X 
XnL - Left {^L}
X 
X     'L' moves the cursor n characters to the left. 
X 
X 
XM - Memory and Status {<Esc>M}
X 
X     The 'M' command is used to display certain status information.
XThe name of the file currently being edited (where the output will go)
Xis displayed, followed by the version of TVX.  The number of free
Xcharacters currently available in the buffer is then given (this does
Xnot include characters that are free but not compacted yet), followed
Xby the number of the last line of the file.  Finally, the currently
Xselected repeat loop buffer and maximum number of repeat buffers
Xallowed is shown. 
X 
X 
XnN - Note current location {^N}
X 
X     This command notes the current line location.  Values of 1 to 9
Xare allowed for n. After entering '3n' for example, you can then move
X 
X 
X                                 -10-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xaround the buffer, and later use '3^n' to return to the noted
Xlocation.  This command really remembers the current line, relative to
Xthe current buffer beginning.  Thus if you edit out lines before the
Xnoted location, you will not return to the same line. 
X 
X 
Xn^N - Go back to noted location {<Esc>N}
X 
X     This command is used to go back to a noted location. 
X 
X 
XnO - Open line for insert {^O}
X 
X     The 'O' command will cause n blank lines to be inserted, and the
Xcursor positioned at the beginning of the first new line.  Following
Xthe 'O' command, insert mode is automatically entered.  The 'O'
Xcommand is a convenient method for inserting new lines. 
X 
X 
X^O - Operating System call {<Esc>O}
X 
X     Some versions of TVX (MS-DOS and Unix, for example), will allow
Xan operating system command to be executed from inside of the editor.
XFor example, it might be useful to get a directory listing.  On
XMS-DOS, after entering the ^O, the normal 'dir' command is entered.
XAfter the directory is shown by the operating system, pressing any key
Xwill return to the edited file. 
X     This command has one particularly valuable application - editing
Xother files.  For example, you may want to add part of another file to
Xthe file you are currently editing.  Use the '^O' command to edit the
Xother file, and create a temporary file with the part you want to
Xadd.  Then you can use the '^Y' yank command to read in the file.  For
Xexample: Use '^O' to get enter operating system command prompt.  Then
Xenter something like 'tvx otherfile -o=tempfile'.  You will get a new
Xcopy of tvx with the otherfile being edited.  Edit it to get the part
Xyou want.  When you exit that copy of tvx, the part you want to add
Xwill be in tempfile.  You can now yank it into the current file. 
X 
X 
XnP - Page {^P}
X 
X     The 'P' commands is the same as '25D' on 24 line terminals, and
Xeffectively causes a new screenful to be written.  It is a convenient
Xmethod for scanning through the file.  The n count argument specifies
Xthe number of 'pages' to scroll.  Negative values for n causes reverse
Xscrolling. 
X 
X 
X^P - Print Screen {<Esc>P}
X 
X     If '^P' (Control-P) is entered, and a printer is on line, the
Xentire contents of the screen will be sent to the printer.  Several
Xconsecutive sequences of "P^PP^P..." (or a repeat loop: "10<P^P>$$")
Xcan be used to print longer portions of the file.  This command will
Xnot normally work on time shared systems such as Unix. 
X 
X 
X 
X                                 -11-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
XnR - Right {^R}
X 
X     'R' causes the cursor to move n characters to the right.  For
Xconvenience, the space bar is equivalent to 'R'. 
X 
X 
X^R - Restore repeat buffer {<Esc>R}
X 
X     The '^R' command will save an edited repeat buffer and delete the
Xedited buffer from the text.  See '^E' for a complete summary of
Xediting repeat buffers. 
X 
X 
XnS - Save text {<Esc>S}
X 
X     Besides the normal text buffer, TVX has a separate "save"
Xbuffer.  This buffer can be used to move blocks of text from one part
Xof the file to another.  A simple 'S' command will save the current
Xline in the save buffer, and move the cursor down one line.  On the
Xscreen, 'S' appears to have the same behavior as 'D'.  If n is
Xsupplied, then n lines will be saved.  'S' can also be used
Xsequentially.  If no other commands intervene, consecutive 'S'
Xcommands will continue adding lines to the save buffer.  If any other
Xcommands are entered between consecutive 'S' commands, the previous
Xcontents of the save buffer will be lost, and replaced with the new
Xline.  The 'A' command can be used to append lines to the current save
Xbuffer without losing the previous contents. 
X     The '/' command can be used with 'S' and 'G' to move text.  Use
X'S' to save the text to be moved, immediately delete the saved text
Xwith '/', then insert it at the new place with 'G'.  The last line of
Xthe file is can be saved in the save buffer only once, and an error
Xmessage will be printed if you attempt to save the last line a second
Xtime. 
X 
X 
XnT - Tidy text {^T}
X 
X     The 'T' tidy command is specifically designed to improve the
Xappearance of strictly text files.  When entering letters and
Xdocuments, is it usually desirable to have the lines filled to the
Xright margin.  However, after editing, it is common to find a jumble
Xof uneven, difficult to read source lines.  The 'T' tidy command will
Xfill source text using the same right margin currently set for
Xauto-wrap. 
X     Tidy performs essentially the same operation as a word processor
Xfill function.  Word are combined on one line until the auto-wrap
Xmargin is passed.  The 'n' count refers to the total number of
Xresulting lines, not the number of original lines.  Specifying a large
X'n' will tidy large sections of a document.  The tidy command
Xrecognizes lines beginning with blanks, tabs, or a period and blank
Xlines as special.  It will not fill those lines, thus preserving
Xparagraphs, tables and NROFF-like dot commands. 
X     One interesting capability of tidy is to put one word per source
Xline.  Set the auto-wrap margin to 2, then use the tidy command.  The
Xresult will put one word per line. 
X 
X 
X 
X                                 -12-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
X^T - TERMINATE - ABORT EDIT SESSION {<Esc>T}
X 
X     The '^T' (Control-T) command aborts directly to the operating
Xsystem.  The original file is left untouched, and no backup file is
Xcreated.  This is a fairly dangerous command in that all editing
Xperformed will be lost (unless the '^B' file beginning command was
Xused).  You will be asked to confirm the '^T' command with a Y or N.
XIf the '^T' is performed accidentally, the backup log file can be
Xapplied to the current version of the file after the '^T' has been
Xedited out of the log file (no backup file will have been created
Xafter the '^T').  The '^T' command is most useful when you decide you
Xdon't want to make any changes and want to exit from TVX quickly.
XExiting with the '^T' command is similar to using the 'R' read only
Xswitch at the beginning. 
X     If you have used the '^B' command, a work file copy of the
Xoriginal will have been written out containing all the edits performed
Xbefore the '^B'.  When you use '^T' and this work file has been saved,
Xa message informing you of its existence will be printed.  You can
Xthen either use that file, or delete it at the operating system
Xlevel. 
X 
X 
XnU - Up {^U}
X 
X     The 'U' command moves the cursor up n lines, positioning the
Xcursor at the beginning of the line. 
X 
X 
Xn^U - Up in column {<Esc>U}
X 
X     The '^U' (Control-U) is the opposite of '^D', and moves the
Xcursor up in column. 
X 
X 
XnV - Verify the screen {^V}
X 
X     In regular screen editing mode, the 'V' command causes the screen
Xto be rewritten.  This is sometimes necessary to get a true version of
Xthe screen after error messages have been written or when editing
Xlines longer than 80 columns.  On terminals without reverse screen
Xscroll, the 'V' command forces the cursor to the home display line
X(usually line 16).  In screen mode, 'V' ignores any n.
X     In tty mode, the 'V' command is used to type lines from the file
Xon the terminal.  A negative n will type out lines preceding the
Xcurrent line.  An n of 1 types the current line, with the current
Xcursor position indicated by '/'.  An n greater than 1 types the
Xcurrent line, plus the following n-1 lines.  A command '-12v12v' would
Xtype 24 lines on the terminal: 12 before, the current line, and 11
Xfollowing. 
X 
X 
Xn^W - Write out buffer, read next one {<Esc>W}
X 
X     The '^W' (Control-W) command is used to explicitly go from one
Xbuffer to the next.  By default, when n is >= 0, the entire current
Xbuffer is written to the new version of the file being edited, and the
X 
X 
X                                 -13-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xnext buffer full of the original file (if any) is read in.  If a
Xnegative n is supplied (any negative value, most easily -^W), then
Xonly the part of the buffer up to (but not including) the current line
Xis written.  Then as much more of the file as possible is read to the
Xend of the current buffer.  Thus, a negative n is useful when a file
Xwon't fit, and the split point is at an awkward place.  It is also
Xuseful when a '^Y' yanked file won't fit. 
X 
X 
X^X - eXit {<Esc>X}
X 
X     '^X' (Control-X) causes the remainder of the file to be written
Xout, and the editor exited.  The entire file will be written, no
Xmatter where the cursor happens to be positioned when the '^X' command
Xis entered.  This is the normal conclusion of an editing session.  All
Xwork files are deleted, the original file renamed to the back up file,
Xand the newly edited file renamed to the original name.  See the
Xappendix on tvx file handling conventions for more details. 
X 
X 
Xn^Y - Yank text to/from external file (file merge) {<Esc>Y}
X 
X     A '^Y' (Control-Y) with a positive n is similar to 'S' save, but
Xthe text saved in the save buffer is read in from an external file
Xinstead of from the current buffer.  When '^Y' is entered, the save
Xbuffer is cleared, the buffer compactor invoked, and then the user is
Xprompted for the name of the file to read.  TVX then will read as much
Xof the external file into the save buffer as it can.  The 'G' command
Xcan then be used to insert the save buffer text into the current file
Xat the desired location.  If there is not enough room in the save
Xbuffer to hold the entire file, then only part of the file is read and
Xa diagnostic message printed.  The '-S' switch can be used when TVX is
Xfirst invoked to reserve a large save buffer for merging larger
Xfiles.  You can also use the '-^W' command to write out the front part
Xof the file, and then 'G' to get the saved file.  (Note: '^Y' may not
Xbe used from within a log command file.  See section on backup log
Xfile.)
X     A negative n (e.g., '-^Y') can also be used with the yank
Xcommand.  If the n is negative, then the contents of the save buffer
Xwill be written to a new file.  After '-^Y' is entered, you will be
Xprompted for the name of the output file, and then the contents of the
Xsave buffer will be written to that file. 
X 
X 
XnBACKSPACE - Delete previous character {BS}
X 
X     The BACKSPACE key will delete the previous character on the
Xscreen.  It is also used for editing input keystrokes for Insert,
XFind, and repeat loops. 
X 
X 
Xn; - Find again
X 
X     The ';' (semicolon) command causes the previous pattern to be
Xsearched for again.  This is more convenient that entering 'F$'
Xagain.  The 'n' has the same meaning, positive searches forwards,
X 
X 
X                                 -14-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xnegative backwards. 
X 
X 
X/ - delete last thing {<Esc>/}
X 
X     The '/' (slash) command is useful when used with 'F' (find), 'S'
X(save), 'G' (get), 'TAB' (word right), and '{' (word left).  It causes
Xthe last pattern used to be deleted.  Thus "Fxxx$/Iyyzz$" will delete
Xthe pattern 'xxx' and insert 'yyzz'.  When used after an 'S', it
Xcauses the just saved lines to be deleted from the text buffer (but
Xnot the save buffer).  After the G, it causes the text just inserted
Xfrom the save buffer to be deleted from the text buffer.  After a
X'TAB' or '{', '/' will delete the word or words just skipped over.
XSlash must be used immediately following an 'S', 'G', 'TAB', '{', 'F',
X'^F', or ';' command.  This command knows how to take wild card
Xmatches into account. 
X 
X 
X= - delete last thing and enter insert mode {<Esc>=}
X 
X     The '=' (equals) command is the same as the '/' command, except
Xinsert mode is automatically entered, thus achieving the effect of
X'/I' command sequence. 
X 
X 
X' - Delete previous part of line (single quote) {<Esc>'}
X 
X     The "'" command will delete all the characters in the current
Xline before the cursor. 
X 
X 
X" - Delete rest of line (double quote) {<Esc>"}
X 
X     The '"' command will delete from the cursor forward to the end of
Xthe line.  The "end of line" mark will remain.  Note that the single
Xquote has one tick, representing the "first" part of the line, while
Xthe double quote has two ticks, representing the "second" part of the
Xline. 
X 
X 
X, - beginning of line (comma) {<Esc>,}
X 
X     The ',' command will move the cursor to the beginning of the
Xcurrent line. 
X 
X 
X. - end of line (period) {<Esc>.}
X 
X     The '.' command will move the cursor to the end of the current
Xline. 
X 
X 
X 
X 
X 
X 
X 
X 
X                                 -15-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
X* - Insert last pattern found {<Esc>*}
X 
X     The last pattern found with the find command (up to 100
Xcharacters) is saved in an internal buffer.  The '*' command will
Xinsert that pattern into the text at the current cursor location.  If
Xthe last find pattern included wild card characters, the pattern saved
Xwill be the actual text matched, and not the wild cards themselves.
XYou must be back in command mode to use this command. 
X 
X 
XnTAB, n{ - Skip over words {<Esc>^I, <Esc>{}
X 
X     The 'TAB' (TAB key, CTRL-I) and '{' commands skip over words.  A
Xword is any contiguous set of alphabetic characters (a-z) or digits
X(0-9).  'TAB' moves forwards, while '{' moves backwards.  The 'n'
Xcount may be used to skip over several words at once, and a negative
Xcount reverses the direction of the move.  A value of 0 for n will
Xmove the cursor to the beginning of the current word rather than the
Xprevious word as -{ would.  Note that '{' is usually aliased to '['
Xsince these are often reversed case on different terminals. 
X 
X 
Xn< - begin repeat loop {<Esc><}
X 
X     TVX has up to 9 different repeat loop buffers which allow an
Xarbitrary sequence of commands to be repeatedly executed.  When n< is
Xtyped, the editor echoes 'Repeat: n<' at the bottom of the screen.
XThe user then types in any series of commands to be repeated n times.
XThe repeat command is terminated with a matching '>' and a double
Xescape (echoed as $$).  Repeat loops may not be nested.  The repeat
Xloop has two typical useful functions: one is to replace multiple
Xoccurrences of a string with another (e.g., "10<fone$=two$>$$"), a
Xsecond is to save a complicated sequence of commands to be repeated as
Xnecessary with the '&' command (i.e., a macro facility).  Each repeat
Xloop may have up to 100 characters. 
X     When a repeat loop is entered from the keyboard, it is saved in
Xone of up to 9 repeat loop buffers, each identified by an integer
Xvalue.  The repeat buffer which is currently in use can be set with
Xthe 'n:R' command.  Buffer 1 will be used by default.  The number of
Xrepeat buffers available and the currently active one can be
Xdetermined by using the 'M' command.  The availability of repeat
Xbuffers allows the definition of 'edit macros'.  Commonly used
Xsequences of editor commands can be saved in a given repeat buffer,
Xthen selected with 'n:R' and executed with the '&' command. 
X     For example, "3:R<fpat1$>$$" would select repeat buffer 3 and
Xenter the repeat command into it (and execute the command once).
XOther "macros" could be entered in other buffers, and then the given
Xexample used again by "3:R&".  A count 'n' of 0 can be used to enter a
Xmacro without executing it.  The indirect command file facility ('@'
Xcommand) can also be used to define and load commonly used macros.
XThe results of using one repeat buffer from within another is not
Xguaranteed, and should be tried only at your own risk. 
X     The '#' command has been provided to simplify the above
Xsequence.  Entering '23#4' for example, is exactly the same as
Xentering '4:r23&'.  The n value is a count, and the single digit after
Xthe '#' is the repeat buffer to use. 
X 
X 
X                                 -16-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
X>$$ - End of repeat loop {>$$}
X 
X     The repeat loop is terminated by a '>' and a double escape.
XNote: '$$' represents escape. 
X 
X 
Xn& - execute repeat loop {<Esc>&}
X 
X     The '&' command executes the commands in the currently selected
Xrepeat buffer n times. 
X 
X 
Xn#k - execute repeat loop k {<Esc>#}
X 
X     This command is an easy to execute a specified repeat buffer.
XThe n is a count and the k is a single digit repeat buffer number.
XThis command is exactly equivalent to 'k:rn&'.  Repeat buffer k
Xbecomes the current buffer after '#' is executed. 
X 
X 
Xn~ - change case {<Esc>~}
X 
X     This command chanages the case of the character under the
Xcursor. 
X 
X 
X? - Help {<Esc>?}
X 
X     The '?' command causes help screens to be displayed.  There are
Xtwo help screens.  The first includes a summary of transitory values:
Xa summary of settable ':' parameters, the contents of the repeat and
Xfind buffers, as well as buffer space left.  On 16 bit processors, if
Xthe space left is greater than 32,000 characters, then 30,000+x will
Xbe shown, where the total is 30,000 plus x. The first screen also
Xshows the last 16 commands you have entered.  This may be useful if
Xyou entered "commands" while you thought you were in insert mode to
Xsee what your keystrokes might have done.  The second screen of help
Xsummarizes the command set. 
X 
X 
X@ - Invoke command file {<Esc>@}
X 
X     Causes a prompt for command file name.  Commands in that file are
Xthen read in and executed.  See description of backup command files
Xbelow for details.  This command is most useful for loading repeat
Xmacros. 
X 
X 
Xn:P - Set special parameters {<Esc>:}
X 
X     The ':' (colon) command is used to set several TVX
Xcharacteristics.  The value n entered before the ':' is the value to
Xset the parameter to, and the character P that follows the ':' defines
Xthe parameter to set.  Valid parameters include:
X 
Xn:A - set autoindent.  A value of 1 turns on autoindent, 0 off.
X 
X 
X                                 -17-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
X   Autoindent is useful for programmers.  When autoindent is on, each
X   new line started while in insert mode will be indented to the same
X   leading tab/blank space as the previous line.  Use blanks or tabs
X   to add indentation, and backspace to backup over indentation. 
X 
Xn:C - set cut mode.  When cut mode is enabled (1), killed lines are
X   also saved in the save buffer.  This works for individual kill
X   commands, e.g.  'kkk' will save only the line associated with the
X   3rd k, while '3k' will save 3 lines in the save buffer.  With cut
X   mode off, kill line does not save the lines in the save buffer. 
X 
Xn:D - set home "display" line to n. The display line is the line the
X   cursor homes to after a verify command.  (Default home display
X   line: 16 on 24 line terminals, 9 on 16 line terminals.)
X 
Xn:E - Expand tab value.  The default value for ':E' is 8, which causes
X   the tab character (^I) to be expanded to multiples of 8 columns.
X   This is the standard used on most systems.  Setting ':E' to 0 will
X   cause tabs to be displayed as '^I' instead.  Other values are
X   possible, but less useful. 
X 
Xn:F - Find case mode: n <= 0 sets find mode to search for exact case
X   of pattern, n > 0 (default) set search mode to ignore upper/lower
X   case. 
X 
Xn:M - Match wild cards.  (default=1).  If on, then matching of the TVX
X   wild card sets is enabled.  If off, then the wild card control
X   characters will match the actual control characters in the file. 
X 
X:o - set output file name.  When ':o' is entered, you will be prompted
X   for the name of the edited output file.  This overrides the '-o'
X   command line switch, and can be used to change your mind about the
X   name of the edited file.  If the output file name is different than
X   the input file name, the input file will not be renamed to the
X   backup file name. 
X 
Xn:R - select repeat buffer n. (default=1).  Repeat buffer n becomes
X   the current repeat buffer executed with the '&' command.  The 'm'
X   status command will show how many repeat buffers are available for
X   a given implementation. 
X 
Xn:S - scroll lines: This parameter sets how many lines the cursor will
X   move before the screen scrolls.  The exact effect of the scroll
X   parameter depends on the terminal characteristics.  On terminals
X   that allow a blank line to be inserted at the top, ':S' sets how
X   many lines cursor will move above and below home display line
X   before scrolling.  Default is 0. Changing the scroll value to 4
X   would let the cursor move up and down 4 lines from the home display
X   line before actually scrolling the screen.  Some users might find
X   this update mode more pleasant to use.  This will be almost
X   essential on heavily loaded time shared systems.  For terminals
X   that do not allow a blank line to be inserted at the top (no
X   reverse scroll), 'n:S' sets how many lines cursor will move above
X   the home display line before the screen is rewritten.  Default is
X   14, which causes the cursor to move nearly all the way to the top
X   before rewriting the screen. 
X 
X 
X                                 -18-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xn:T - tty mode.  A 0 is screen mode, a 1 is tty mode. 
X 
X:U - set User Wild Cards.  After entering :U, you will be prompted for
X   a user wild card set.  You can use backspace to correct your entry,
X   and '<Esc><Backspace>' to enter backspace and '<Esc><Esc>' to enter
X   escape. 
X 
Xn:V - virtual window lines.  The 'n:V' will set the virtual window to
X   n lines.  N must be between 3 and the number of hardware lines on
X   the terminal.  A smaller virtual window is extremely useful on busy
X   time shared systems, or when TVX is used over a telephone line at a
X   relatively slow baud rate.  Typically, a virtual window of 7 or 9
X   is big enough to show a reasonable part of the file, yet small
X   enough to reduce the overhead of screen update at slow speeds.  A
X   window of 3 or 5 can even be used if needed.  Note that the virtual
X   window can be set at start up time by using the '-#' switch.  The
X   virtual window will use the top n physical lines of the display.
X   Error messages and prompts will still be displayed on the bottom
X   physical line.  Scanning up with 'u' will cause the lines to be
X   scrolled onto the unused part of the screen, and gives a true
X   picture of the file showing more lines than the window size. 
X 
Xn:W - set auto wrap width.  The ':W' parameter sets the column number
X   used for auto wrap mode.  When the auto wrap is set to a value
X   greater that 1, TVX will automatically insert an end of line when
X   the user types the first blank after the given column.  Normally,
X   the user must manually hit the RETURN key to force an end of line.
X   The auto wrap mode allows continuous entry of text without worrying
X   about the right margin.  A good value to use for ':W' is 10 columns
X   less than the screen width (70 on 80 columns screens). 
X 
XAn invalid parameter value or name causes an error message. 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X                                 -19-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
X                   *** BACKUP LOG FILE FEATURE ***
X 
X     TVX has a backup log file feature.  When the feature is enabled,
Xall commands entered in any given session are saved on a file called
X"BACKUP.LOG" on the current directory or drive.  If for some reason
Xyou destroy your file during an editing session (like accidentally
Xentering "100^K" instead of "100K"), you won't have to manually
Xre-edit the backup version of the file.  (By default, the log file is
Xdisabled.  The 'L' invocation time switch will respectively disable or
Xenable the log file feature.)
X 
X     The "BACKUP.LOG" file contains all the commands you entered in
Xthe last session.  Most commands will appear in the log file as you
Xentered them: R, U, D, etc.  However, all control characters,
Xbackspace, and the atsign are encoded in the log file to make them
Xappear as printable characters.  The atsign '@' is used as an encoding
Xcharacter.  So, for example, tabs appear as '@I', escapes as '@[',
XRETURNs as '@M', and so on.  Control-A would appear as '@A'.  The '@'
Xitself would appear as '@@'.  Backspace appears as '@H'.  These escape
Xsequences may be split across the end of a line in the log file.  The
Xend of line marks in the log file are not part of the command stream
Xand are ignored. 
X 
X     The procedure for using the "BACKUP.LOG" file to restore your
Xfile is as follows.  When you realize you have made a mistake, enter
Xthe '^X' exit command.  Copy "BACKUP.LOG" to a temporary working
Xfile.  Now edit that temporary version of the log file to remove the
Xmistakes, which should be near the end of the file. 
X 
X     Once the log file has been edited to remove the bad commands, you
Xshould then re-edit the original file (the one without the mistakes).
XThe latest version of the file will be the one with the mistakes, and
Xshould usually be killed.  Start TVX and read in the file.  Then enter
Xthe '@' command and supply the name of the "repaired" log file.  All
Xthe commands in that log file will be applied to the original file.
XYou should be careful to start the '@' command when the cursor is at a
Xspecific place such as the beginning of the file.  After the '@'
Xcommand is finished, your file will be in the same shape it was before
Xthe mistake. 
X 
X     For example, suppose you are editing a file called "MYFILE0.TXT"
Xand that you accidentally kill 100 lines.  When you realize your
Xmistake, you enter '^X' to exit.  Then you should copy or rename the
XBACKUP.LOG file to a new temporary file - say FIX.LOG.  The current
Xversion of the file you were editing is the bad file and should be
Xdeleted.  On CP/M and MS-DOS versions, you would rename MYFILE0.BAK to
Xbe MYFILE0.TXT again.  Then, edit FIX.LOG to remove the command that
Xkilled 100 lines and the quit command ("100 at K@X").  Exit again, and
Xre-edit MYFILE0.TXT.  If you then enter the '@' command, and respond
Xwith FIX.LOG as the name of the command file, your file will be
Xbrought back to the state it was in right before the '100^K'. 
X 
X     There are some special cases that require special attention when
Xusing the backup log file.  These cases involve the entry of file
Xnames or strings, such as for '^Y', ':o', and ':u'.  For 'Y', the file
Xread as a part of the given command is read using the same I/O channel
X 
X 
X                                 -20-
X 
X 
X 
X 
XTVX Reference Manual                                           2/25/86
X 
X 
Xas the backup log file input, and thus both cannot be used at the same
Xtime.  If the backup log file contains any '^Y' commands (displayed in
Xthe log file as '@Y'), you must remove them.  Obviously, this will
Xalter the order of the commands in the file, and you will need to use
Xa special procedure.  Suppose, for example, that the backup log file
Xcontained one '^Y' command.  Make two copies of the backup log file.
XEdit the first, and remove all commands following the '^Y' command,
Xincluding the '^Y' command.  Then edit the other copy, and remove all
Xcommands before the '^Y', including the '^Y'.  Then, edit the backup
Xcopy of the original file.  First, apply the first backup log file.
XThis will get you to the point right before the '^Y'.  Then without
Xchanging the cursor position, manually enter the '^Y' command and file
Xname.  Finally, apply the second copy of the backup log file. 
X 
X     For ':o' and ':u', the filename or user set are not save as part
Xof the log file, and you will in fact be prompted for the file name or
Xuser set while the log file is being executed.  There is no real clean
Xway around this. 
X 
X     It is also possible to write log command files of your own to
Xcarry out specific commands.  This allows the creation of "macros"
Xthat can be executed as needed.  When creating log files of your own,
Xyou should remember that control characters and backspaces must appear
Xas encoded characters.  The '@' is the encoding character.  Control
Xcharacters will appear as '@' followed by the appropriate letter: '^I'
X= '@I', enter = '@M', etc.  An '@' itself is '@@', and backspace is
X'@H', although you should never need a backspace in your own files
X(use -K). 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X 
X                                 -21-
X
X 
SHAR_EOF
echo ALL DONE!
exit 0



More information about the Mod.sources mailing list