 |
OpenVMS User's Manual
8.16.1 Using Buffer-Change Journaling
Buffer-change journaling creates a journal file for each text buffer.
(EVE does not create buffer-change journal files for system buffers
such as the Insert Here buffer, DCL buffer, or $RESTORE$ buffer.) As
you edit a buffer, the journal file records the changes you make, such
as erasing, inserting, or reformatting text. When you exit from EVE or
when you delete the buffer, the journal files are deleted. If a system
failure interrupts your editing session, the journal files are saved.
Your last few keystrokes before the system failure may be lost.
Table 8-11 summarizes the EVE commands for buffer-change journaling
and recovery.
Table 8-11 EVE Commands for Buffer-Change Journaling and Recovery
Command |
Function or Effect |
RECOVER BUFFER
|
Recovers a specified buffer by using the journal file for the buffer.
You can specify the name of the buffer or file you want to recover or
the name of the journal file for the buffer.
|
RECOVER BUFFER ALL
|
Recovers all your text buffers, one at a time, by using the journal
files for the buffers, if there are any.
|
SET JOURNALING
|
Enables buffer-change journaling for a buffer that you specify.
|
SET JOURNALING ALL
|
Enables buffer-change journaling for all your buffers. This is the
default setting.
|
SET NOJOURNALING
|
Disables buffer-change journaling for a buffer that you specify.
|
SET NOJOURNALING ALL
|
Disables buffer-change journaling for all your buffers.
|
Buffer-change journal files are written in a directory defined by the
logical name TPU$JOURNAL. By default, this directory is SYS$SCRATCH,
which is typically your top-level (login) directory. You can redefine
the TPU$JOURNAL logical name to have the journal files written to a
different directory. For example, the following commands create a
subdirectory called [USER.JOURNAL] and then define TPU$JOURNAL as this
subdirectory:
$ CREATE/DIRECTORY [USER.JOURNAL]
$ DEFINE TPU$JOURNAL [USER.JOURNAL]
|
You can put the definition in your LOGIN.COM file.
Buffer-change journal files may be quite large (even larger than the
text files you edit). Because of the potential size of buffer-change
journal files and because there is a journal file for each text buffer,
you may want to define TPU$JOURNAL as a directory or subdirectory on a
large disk, rather than as SYS$SCRATCH.
Deriving Buffer-Change Journal Names
Buffer-change journal file names are derived from the name of the file
or buffer being edited and the default file type for the operating
system. To find out the name of the journal file for the current
buffer, enter the SHOW command at the EVE prompt. The SHOW command
displays the name of your input file, output file, your journal file,
and other information about your current buffer.
Table 8-12 shows the buffer-change journal file names.
Table 8-12 Buffer-Change Journal File Names
Text Buffer Name |
Buffer-Change Journal File |
JABBER.TXT
|
JABBER_TXT.TPU$JOURNAL
|
GUMBO_RECIPE.RNO
|
GUMBO_RECIPE_RNO.TPU$JOURNAL
|
MAIN
|
MAIN.TPU$JOURNAL
|
LATEST NEWS
|
LATEST_NEWS.TPU$JOURNAL
|
Using Buffer-Change Journaling to Recover Edits
There are two ways to recover your edits with buffer-change journal
files:
- Use the /RECOVER qualifier on the EDIT command line when you invoke
EVE.
- Use RECOVER BUFFER commands within EVE.
In the following example, you are editing a file named JABBER.TXT when
a system failure interrupts your editing session. You then use system
recovery to recover your edits.
$ EDIT JABBER.TXT
.
.
.
*** system failure ***
.
.
.
$ EDIT JABBER.TXT/RECOVER
|
Using the RECOVER BUFFER Command
To use the recover buffer command, follow this procedure:
Step |
Task |
1
|
Invoke EVE and enter the following command to recover your text:
Command: RECOVER BUFFER
file-name.txt
If the buffer-change journal file is available, EVE shows the
following information and asks if you want to recover that buffer:
Name of the buffer
Original input file for the buffer, if any
Output file for the buffer, if any
Source file for recovery, if any
Starting date and time of the editing session
Journal file creation date and time
|
2
|
Press the Enter key to recover your buffer.
If you do not want to recover your buffer, type No and press the
Enter key. If you delete or rename the source file for recovery, the
recovery fails. The source file is either the file initially read into
the buffer (if any) or the last file written before the system failure.
If the buffer you want to recover exists (usually the Main buffer),
EVE first deletes that buffer and then does the recovery. If the buffer
you want to recover has been modified, EVE asks you whether to delete
the buffer before recovering.
|
How to Recover When You Are Unsure of the File Name
If you are unsure of the buffer names or journal file names, specify
the asterisk (*) wildcard, as follows:
Command: RECOVER BUFFER *
|
EVE then displays a list of all your available journal files so you can
choose the one you want. The list appears in an EVE system buffer named
$CHOICES$ in a second window. For information about using the $CHOICES$
buffer, see the EVE online help topic called Choices Buffer.
How to Recover All Buffers
To recover all your text buffers---one at a time---use the RECOVER
BUFFER ALL command. EVE then tries to recover each text buffer for
which there is a buffer-change journal available. The effect is the
same as repeating the RECOVER BUFFER command without having to specify
buffer names or journal file names. For each text buffer, EVE displays
information such as the buffer name, the files associated with the
buffer, and the time and date the journal file was created. EVE prompts
you for one of the following:
Response |
Effect |
Yes
|
Recovers the buffer and then asks you whether to recover the next
buffer, if there is one. This is the default response. Press the Enter
key.
|
No
|
Skips this recovery. If there is another buffer to recover, EVE asks
you about the other buffer.
|
Quit
|
Cancels---does not recover the buffer and does not continue recovery
operations.
|
Disabling Buffer-Change Journaling
You can disable buffer-change journaling for a particular buffer by
using the SET NOJOURNALING command. To disable buffer-change journaling
for all your buffers, use the SET NOJOURNALING ALL command.
Enabling Buffer-Change Journaling
If you disabled buffer-change journaling, you can enable journaling by
using the SET JOURNALING command. The following command enables
journaling for a buffer named JABBER.TXT:
Command: SET JOURNALING JABBER.TXT
|
If you invoked EVE without journaling and then want to enable
buffer-change journaling during the editing session, use the SET
JOURNALING ALL command (which is the EVE default).
You cannot enable buffer-change journaling if the buffer has been
modified. In such a case, EVE displays the following message:
Command: SET JOURNALING MEMO.TXT
Buffer MEMO.TXT is not safe for journaling
|
You should first write (save) the buffer by using the WRITE FILE or
SAVE FILE command and then enable journaling.
8.17 EVE Formatting Commands
EVE provides commands that let you format your text by setting margins,
tabs, and word wrap. You can center lines, take extra white space out
of text, and insert page breaks.
Table 8-13 shows EVE editing keys and describes their functions.
Table 8-13 EVE Editing Keys and Their Functions
Key or Key Sequence |
Function |
Return or Ctrl/M
|
Inserts a carriage return at the current position either to start a new
line of text or to terminate a command you are typing. On VT200, VT300,
and VT400 series terminals, EVE also defines the Enter key as Return.
|
Tab or Ctrl/I
|
Inserts a tab character at the current position according to the tab
modes and at the tab stops currently set.
|
Ctrl/L
|
Inserts a form-feed character at the current position to mark the
beginning of a new page. A page break appears as a small double F (FF )
and is always on a line by itself. Same as INSERT PAGE BREAK.
|
Table 8-14 shows EVE text formatting commands and describes their
functions.
Table 8-14 EVE Text Formatting Commands and Their Functions
Command |
Function |
CAPITALIZE WORD
|
Changes the case of a word, making the first letter uppercase and the
rest of the letters lowercase. Works on a range, box, or single word.
|
CENTER LINE
|
Centers the current line between the left and right margins. The cursor
moves with the line, remaining on the same character as the line moves.
|
CONVERT TABS
|
Converts tab characters to the appropriate number of spaces in a box, a
range, or the entire buffer.
|
FILL
|
Reformats the current paragraph, range, or box according to the margins
of the buffer, so the maximum number of words fits on a line. When you
fill a select range or found range, the FILL or FILL RANGE command does
not reformat a line that begins with a page break, a DIGITAL Standard
Runoff (DSR) command, or DOCUMENT tag; it does reformat the other lines
in the range. Filling a range does not delete blank lines. For more
information about select range, see Section 8.9.
|
FILL PARAGRAPH
|
Reformats the paragraph that the cursor is in according to the margins
set for the buffer. When you fill a paragraph, the FILL command does
not reformat a line that begins with a page break, DSR command, or
DOCUMENT tag; it does reformat the other lines in the paragraph.
|
FILL RANGE
|
Reformats the range or box according to the current margin settings.
When you fill a select range or found range, the FILL or FILL RANGE
command does not reformat a line that begins with a page break, DSR
command, or DOCUMENT tag; it does reformat the other lines in the
range. Filling a range does not delete blank lines.
|
INSERT PAGE BREAK
|
Inserts a form-feed character at the current position to mark the
beginning of a new page. A page break appears as a small double F (FF )
and is always on a line by itself. By default, Ctrl/L is defined as
INSERT PAGE BREAK.
|
LOWERCASE WORD
|
Changes the current word, range, or box to lowercase.
|
PAGINATE
|
Inserts a "soft" page break for a 54-line page. A soft page
break appears as a form feed followed by the null character (FF NL ).
When you enter the PAGINATE command, EVE moves back to the previous
page break (if any) then checks ahead for page breaks within the next
54 lines. If any soft breaks are found within those 54 lines, EVE
removes them. EVE then moves down 54 lines, inserts a soft break, and
puts the cursor on the next line. The soft break is inserted on a line
by itself. If a hard page break (form feed only) is found within the 54
lines, EVE stops on the line after the hard break, in case you want to
erase the break.
|
SET LEFT MARGIN
|
Sets the left margin in the current buffer. The left margin must be
greater than 0 but less than the right margin. By default, the left
margin is 1 (leftmost column).
|
SET RIGHT MARGIN
|
Sets the right margin for the current buffer. The right margin must be
greater than the left margin. By default, the right margin is one less
than the width. The width is typically 80, so the default margin is
typically 79.
|
SET PARAGRAPH INDENT
|
Specifies the number of spaces to be added to or subtracted from the
first line of paragraphs you create or reformat. The default is 0 (no
indent).
|
SET TABS AT
|
Sets tab stops at the columns that you specify. The column numbers must
be in ascending order and separated by spaces. By default, tab stops
are set every eight columns. The command does not affect the hardware
tab settings of your terminal.
|
SET TABS EVERY
|
Sets tab stops at the specified interval. By default, tab stops are set
every eight columns. The command does not affect the hardware tab
settings of your terminal.
|
SET TABS INSERT
|
Default setting. Changes the tab mode so that EVE inserts a tab
character at the current column when you press the Tab key. The cursor
and text move to the next tab stop.
|
SET TABS MOVEMENT
|
Changes the tab mode so the Tab key becomes a cursor-movement key.
Pressing the Tab key moves the cursor to the next tab stop but does not
insert a tab character.
|
SET TABS SPACES
|
Changes the tab mode to insert an appropriate number of spaces, rather
than a tab character, when the Tab key is pressed. Previously existing
tab characters are not affected.
|
SET TABS INVISIBLE
|
Default setting. Makes tab characters invisible on the screen,
appearing as white space.
|
SET TABS VISIBLE
|
Makes tab characters visible on the screen, appearing as a small HT
(horizontal tab).
|
SET NOWRAP
|
Disables word wrapping at the right margin of the buffer. To start new
lines, press the Enter key or use the FILL command.
|
SET WRAP
|
Default setting. Enables word wrapping at the right margin of the
buffer. EVE starts new lines without you pressing the Enter key or
using the FILL command.
|
UPPERCASE WORD
|
Changes the current word, range, or box to uppercase.
|
8.18 Using Buffers
Buffers are storage areas that exist only during an editing session.
When you edit an existing file, EVE reads the contents of the file into
a buffer. The highlighted status line contains the name of the buffer,
its editing status (read-only or write), editing mode (insert or
overstrike), and direction (forward or reverse).
Table 8-15 describes the EVE commands used to create, manipulate,
and delete buffers.
Table 8-15 EVE Commands to Manipulate Buffers
Command |
Function |
BUFFER
|
Puts the specified buffer into the current window and moves the cursor
to the last location it occupied in that buffer. If the specified
buffer does not exist, creates a new buffer.
|
DELETE BUFFER
|
Deletes a buffer you specify by name.
|
GET FILE
or OPEN
|
Puts the specified file into the current EVE window, creating a new
buffer if necessary. If the file exists, EVE copies it into a new
buffer in the current window. If the file does not exist, EVE creates a
new, empty buffer, using the file name and file type for the buffer
name. If there already is a buffer by that name, EVE asks for a
different name to use.
|
GO TO
|
Returns the cursor to the location labeled by the MARK command. If the
labeled location is found in another buffer, EVE moves the cursor to
that buffer and puts it into the current window. (Section 8.18.5
explains how to use multiple buffers in an editing session.)
|
INCLUDE FILE
|
Inserts the contents of the specified file into the current buffer at
the line above the cursor location. This is useful to combine files.
|
NEW
|
Creates a new buffer named Main and puts it into the current window. If
the buffer Main already exists, EVE asks for a name for the new buffer.
|
NEXT BUFFER
|
Puts the next buffer (if one exists) into the current window and moves
the cursor to the last position it occupied in that buffer. This
command lets you move from one buffer to another without specifying a
buffer name.
|
OPEN SELECTED
|
Opens a file whose name you have selected or found. This command is the
same as using the GET FILE or OPEN command without having to type the
file name.
|
REMOVE
or CUT
|
If you are in the Buffer List buffer, same as DELETE BUFFER. Use the
REMOVE command as follows to delete a buffer without typing the buffer
name: enter the SHOW BUFFERS command (which puts you in the Buffer List
buffer), move the cursor to the name of the buffer you want to delete,
and enter the REMOVE command.
|
SAVE FILE
|
Writes the contents of the current buffer to the file associated with
the buffer without ending the editing session. If you do not specify a
file name with the SAVE FILE command, EVE prompts you for an output
file specification. Similar to WRITE FILE.
|
SAVE FILE AS
|
Writes the contents of the current buffer to the file you specify
without ending the editing session. For example, if you are editing a
file named FIRST.DAT, you can save it as SECOND.TXT. This command does
not change the name of the buffer. It does, however, associate the
buffer with the file you name so that any subsequent SAVE FILE, WRITE
FILE, or EXIT command writes the buffer to the file you named. This
command requires you to supply a file specification.
|
SELECT
or RETURN
|
If you are in the Buffer List buffer, selects the buffer you specify.
Use the SELECT command as follows to select a buffer without typing the
buffer name: enter the SHOW BUFFERS command, move the cursor to the
name of the buffer you want to select, and enter the SELECT command.
|
SET BUFFER
|
Lets you specify the editing status of the buffer: whether the buffer
can be modified or can be written to a file when you exit from EVE.
|
SHOW
|
Displays information about the buffers you have created during the
editing session. If more than one buffer is active in your editing
session, the SHOW command displays information about the buffer you are
currently editing. For information about the other active buffers,
press the Do key. To resume editing, press any other key.
|
SHOW BUFFERS
|
Lists the buffers you have created during an editing session. You can
move the cursor through the list and specify a particular buffer for
viewing by pressing the Select key.
|
SHOW DEFAULTS BUFFER
|
Shows information, such as margins, tab stops, direction, mode, and
maximum lines, about the EVE system buffer named $DEFAULTS$. These are
the default settings used when you create new buffers.
|
SHOW SYSTEM BUFFERS
|
Lists the system buffers created by EVE, such as the Message buffer,
Help buffer, Insert Here buffer, and $RESTORE$ buffer. You can move the
cursor through the list and specify a buffer for viewing by pressing
the Select key.
|
WRITE FILE
|
Writes the contents of the current buffer to the file associated with
the buffer or to the file you specify on the command line without
ending the editing session. If the current buffer does not have a file
specification associated with it, EVE prompts you for an output file
specification. Similar to SAVE FILE.
|
|