Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://www.stsci.edu/ftp/documents/system-docs/vms-guide/V04_edit.ps
Äàòà èçìåíåíèÿ: Wed Nov 1 17:30:00 1995
Äàòà èíäåêñèðîâàíèÿ: Sun Dec 23 06:38:42 2007
Êîäèðîâêà:

Ïîèñêîâûå ñëîâà: spirit rover
DECTPU 69
CHAPTER 4 :
Editing
Files
In This Chapter...
DECTPU / 69
Emacs / 80
EDT / 85
Language Sensitive Editor: LSE / 88
Spell Checkers / 90
Other Text Tools / 91
Several text editors are available on Institute computers. The standard
editor for OpenVMS systems is DECTPU, the DEC Text Processing
Utility. If you use several different platforms, you may want to use Emacs.
Long­time VMS users may prefer to use EDT, which is still available.
There is also a language­sensitive editor called LSEDIT 1 which is useful
for editing programming language or L A TEX source files. LSEDIT is
based on DECTPU.
DECTPU
The DEC Text Processing Utility (DECTPU) is a generic set of editing
tools that are accessed through various interfaces and the default editor.
There is an EDT interface that looks and acts like the usual EDT editor, but
that actually uses DECTPU. The default interface is known asEVE, which
stands for Extensible Versatile Editor. EVE has several advantages over
1. See VAX Language­Sensitive Editor (LSE) Quick Reference Guide for the
LaTeX Environment, by Kent McPherson. Copies are available from the Software
Support Office in the Science Software Branch.
69

70 Chapter 4: Editing Files
EDT. For example, it will save all buffers when you exit, whereas EDT will
only save the most­recently active buffer.
EVE is a general­purpose interactive text editor. Its capabilities include:
. Edit multiple files during an editing session.
. Use multiple buffers and windows and resize windows.
. Define keys and macros.
. Set user preferences, such as cursor movement.
. Cut and paste columns of text.
. Search text using wildcards.
. Check spelling in a buffer.
. Run DCL commands from within the editor.
Starting DECTPU
To use DECTPU with EVE (the default interface) type:
$ EDIT/TPU
EVE will create an empty buffer called MAIN. A buffer is a temporary
holding area. There is now a screen containing a reversed­video status line
at the bottom that looks like Figure4.1.
Figure 4.1: EVE Main Buffer
Buffer: MAIN | Write | Insert | Forward
[End of file]
Status line

DECTPU 71
The status line tells you:
. Name of the buffer you are currently editing.
. Editing status (Read or Write).
. Mode of the current buffer (Insert or Overstrike).
. Direction for the next search or select (Forward or Backward).
The end­of­file marker shows you where the end of EVE's buffer is
located. The marker only displays on the screen---it is not written to your
file.
You can start typing. When you are finished editing the file, press
­ and specify a file name for the document.
If you need to revise a previously­created document, you would use
EVE's GET FILE command, or you can specify the file name when you
first invoke EVE, for example:
$ EDIT/TPU garbage.txt
If you will use EVE as your regular text editor, you may want to create a
symbol called EVE that will invoke the EVE interface. You can do this by
placing the following command in yourLOGIN.COM file:
$ EVE :== EDIT/TPU
To use DECTPU with an EDT keypad (Figure4.7 on page 87 shows the
EDT keypad), invoke DECTPU as described above. Once you are in the
editor, press the key. 2 You will see a Command: prompt below the
status line in the command window. At the prompt, type the command:
set keypad EDT
The application keypad will now function like the keypad in EDT.
If you want to use the EDT keypad every time you use EVE, you can
place the above command in an initialization file used by EVE when the
editor is invoked. The initialization file is called:
SYS$LOGIN:EVE$INIT.EVE
2. On a keyboard without a key, press and look at the keypad dia­
gram. On most terminals, pressing (using the numberic keypad) is equiva­
lent to the key. If you have a Unix workstation, PC, or Macintosh, see your
system manager.
Ctrl Z
Do
Do PF2
PF1 7
Do

72 Chapter 4: Editing Files
Basic Editing
Once the buffer (shown in Figure4.1) is displayed, you can move the
cursor using the arrow keys. Text is displayed in the buffer as you type.
Press the key to display theCommand: prompt in the command
box below the status line. If you are using the EDT keypad or a VT100,
you can also press .
Saving a File and Exiting
Command: EXIT
or
­
Save a File (and Continue Editing)
Command: WRITE
Exit without Saving (Abandon File)
Command: QUIT
Using the EVE Keypad
Figures 4.2 and 4.3 show the EVE keypad. You can also display the
keypad layout by pressing . Table 4.1 lists keystrokes that work with
various keyboards.
Figure 4.2: EVE Keys for VT100 Series Terminals
Do
PF1 7
Ctrl Z
PF2
Top Bottom Start of line End of line
PF1 PF2 PF3 PF4
7 8 9 ­
4 5 6
1 2 3
0 .
,
Enter
Find
Change
Select Remove
Insert
here
Move by
line
Erase
word
Change
mode
Next
screen
Previous
screen
Help
keypad direction Do

DECTPU 73
Figure 4.3: EVE Keys for VT200, VT300, and VT400 Series Terminals
Table 4.1: EVE Keyboard Commands
Keystroke Function
­ Change mode
­ Recall
­ End of line
­ Start of line
Tab
­ Erase word
­ Insert page break
Return
­ Remember
­ Erase start of line
­ Quote
­ Refresh
­ Exit
Help
Do
Find Insert here Remove
Select
keypad
keys
Wild Find Restore Store text
Reset
Prev screen
Prev window
Next screen
Next window
Top
Start of line Bottom End of line
Change Move by Erase word Change
direction line
Res Word mode
F11 F12 F13 F14
Ctrl A
Ctrl B
Ctrl E
Ctrl H
Tab
Ctrl J
Ctrl L
Return
Ctrl R
Ctrl U
Ctrl V
Ctrl W
Ctrl Z
VT200--VT400 Keyboards
Key Function
Delete
Tab
Return
Start of line
Erase word
Delete
Tab
Return
Backsp
Linefee
VT100 Keyboards
Key Function
Delete
Tab
Return
Return
Do
Tab
Return
Enter
PF4

74 Chapter 4: Editing Files
Replacing Text
Command: REPLACE
Old String: Old
New String:New
Replace? Type Yes, No, All, Last, or Quit:
Replace is case sensitive; some examples of the types of matches and
their replacement values are shown in Table 4.2. Note that if you want to
find or replace only lowercase occurrences of a string, you could set the
matching to EXACT, by using the following commandbefore typing the
REPLACE command:
Command: SET FIND CASE EXACT
Table 4.2: Sample Text Replacements
Using Multiple Buffers and Windows
When you begin an EVE editing session, the buffer you are editing is
displayed on the screen with its name shown in the reverse­video status
line at the bottom of the screen. You can view more than one window on
your screen at the same time. For example, you could have two windows
on your screen. Your screen would look like Figure4.4 if you used the
commands below (a list of commands for working with split windows is
provided in Table 4.3) to split the screen between two windows:
Old String New String Matches Replacement
hello howdy hello howdy
Hello Howdy
heLLo howdy
HELLO HOWDY
Hello howdy Hello howdy
hello Howdy hello Howdy
Hello Howdy
HeLLO Howdy
HELLO Howdy
Hello Howdy Hello Howdy

DECTPU 75
$ EDIT/TPU INFO.TXT
Command: SPLIT WINDOW
Command: NEXT WINDOW
Command: GET FILE MORE_INFO.TXT
Figure 4.4: Split Screen in EVE
Buffer: MAIN | Write | Insert | Forward
[End of file]
Buffer: MORE_INFO.TXT | Write | Insert | Forward
Hello:
This mail message is directed to the folks who use the AMBER workstation
to do GASP work.
1) AMBER is now running DECwindows MOTIF. This is just like the windowing
that is running on all other nodes in the Guide Stars Cluster, so this
should not be very new to you.
Editing new file. Could not find: more_info.txt

76 Chapter 4: Editing Files
Table 4.3: EVE Split Window Commands
Cutting and Pasting Rectangular Text Areas
You can select a boxed area containing columns of text and then cut and
paste the box. To do this, follow these steps:
1. Set the selection method to be box (rectangular region):
Command: SET BOX SELECT
2. Move the cursor to the upper left corner of the rectangular box area
that will enclose your text:
3. Begin selecting text by either:
-- Pressing the key, or
-- Command: SELECT
Command Function
SPLIT WINDOW Split window into two or more windows. Four windows?
SPLIT WINDOW 4
TWO WINDOWS Same as SPLIT WINDOW 2
ENLARGE WINDOW Increase window size by specified number of lines, for
example, ENLARGE WINDOW 4
SHRINK WINDOW Decrease window by specified number of lines, for
example, SHRINK WINDOW 3
NEXT WINDOW Move cursor to next window
PREVIOUS WINDOW Move cursor to previous window
DELETE WINDOW Delete current window (if using more than one)
SET WIDTH Set number of characters in line width, for example,SET
WIDTH 132
SHIFT RIGHT Move current window to the right by the specified number
of columns
SHIFT LEFT Move window to left by specified column number
ONE WINDOW Restores current window to single large window---all other
windows are deleted, though their buffers are not
Select

DECTPU 77
4. Move the cursor one column past the lower right corner of your boxed
area. The selected text will be highlighted.
5. Cut the selected text using either of the following methods:
-- Pressing the key, or
-- Command: REMOVE
6. Move to the position where you want to paste the text and move the
cursor to the upper left corner of the location for the text.
7. Paste the contents of the buffer by either:
-- Press the key, or
-- Command: INSERT HERE
Help
You can get extensive online help any time while editing. There are two
kinds of help available: keypad help and EVE help.
. To get keypad help, press the key. A diagram of the keypad is dis­
played. Follow the directions on the screen to get information on key
definitions, EVE commands, or defined keys. To exit from keypad help,
press the key. The keypad displayed here will look like those
shown in Figures 4.2 and 4.3.
. To get EVE help, press the key. At the Command: prompt (in the
command window below the status line) typeHELP. Use the and
keys to scroll through available help topics. Exit from help by
pressing the key. A sample of the EVE help is shown in
Figure 4.5.
Remove
Insert Here
Help
Return
Do
PrevScr
NxtScr
Return

78 Chapter 4: Editing Files
Figure 4.5: EVE Help
Recovery
DECTPU creates journal files that save your editing commands so that
your editing session can be recovered if a system failure occurs. DECTPU
provides two journaling methods: keystroke journaling and buffer­change
journaling. You can use both methods simultaneously except under
DECWindows: only buffer­change journaling can be used with
DECWindows.
Keystroke Journaling
DECTPU keeps track of each keystroke that you type in a special file
called the journal file, regardless of which buffer is in use. The DECTPU
journal file can be identified by its file type, .
TJL. If the system is
interrupted while you are editing, you can reconstruct your editing session
with the /JOURNAL and /RECOVER qualifiers. Here is an example of
recovering a file calledMEMO.TXT:
$ EDIT/TPU MEMO.TXT /JOURNAL /RECOVER
Buffer­Change Journaling
DECTPU creates a separate journal file for each text buffer. As you edit
a buffer, the journal file records the changes you make---such as moving,
deleting, inserting, or reformatting text. DECTPU puts the journal files in
List Of Topics (Commands)
For help on EVE topics, type the name of a topic and press RETURN.
o For a keypad diagram, press HELP.
o For help on VAXTPU builtins, type TPU and press RETURN.
o To exit from help and resume editing, press RETURN.
EDITING TEXT
Change Mode Erase Word Restore Character
Copy Insert Here Restore Line
Cut Insert Mode Restore Selection
Delete Overstrike Mode Restore Sentence
Erase Character Paste Restore Word
Erase Line Quote Select
Erase Previous Word Remove Select All
Erase Start Of Line Restore Store Text
BOX OPERATIONS
Buffer: MORE_INFO.TXT To see more, use: | Prev Screen | Next Screen
Type the topic you want help on (press RETURN if done):

DECTPU 79
the directory defined by the logical TPU$JOURNAL; the file has a type
.TPU$JOURNAL. You can redefine TPU$JOURNAL to have files written
to a different directory, as shown below:
$ CREATE/DIRECTORY [USER.JOURNAL]
$ DEFINE TPU$JOURNAL [USER.JOURNAL]
You may wish to put this definition in yourLOGIN.COM file.
Here is an example of how to recover the fileMEMO.TXT:
$ EDIT/TPU MEMO.TXT /RECOVER
When you recover files, specify the name of theoriginal file---not the
journal file.
Here is an example of how to recover a buffer from a session of editing
the file MEMO.TXT:
1. Start EVE.
$ EDIT/TPU
2. Type the following command at the EVE prompt:
Command: RECOVER BUFFER MEMO.TXT
Buffer­change journal names come from the name of the buffer or file
being edited. If the buffer­change journal with the name of
MEMO­TXT.TPU$JOURNAL is available, EVE displays information
about the recovery and asks you if you want to recover. Press to
recover, or type NO if you do not want to recover.
If you delete, rename, or move the source file, the recover will fail. The
source file is that last file written before the system failed, or the file ini­
tially read into the buffer.
There are two other ways of recovering buffers that you may find useful:
. If you don't know the name of the buffer, you can choose from a list of
available journal files by using the command:
Command: RECOVER BUFFER *
. If you want to recoverall of your text buffers, EVE can display infor­
mation about each buffer, one at a time, asking you if you want to
recover each. To do this, use the command:
Return

80 Chapter 4: Editing Files
Command: RECOVER BUFFER ALL
Initialization Files
If you have a certain set of commands or defaults that you regularly use
when editing files, you can save them in an initialization file that can then
be invoked when you start editing a new file. This is especially useful, for
example, when you want to define a format for several documents with
margins and tab settings. If you want to use an initialization file, you need
to specify the file name using aDEFINE statement before running EVE.
For example:
$ DEFINE EVE$INIT sys$login:myeve
$ EDIT/TPU
For more information about DECTPU, see the online help or read the
manual Guide to the DEC Text Processing Utility.
Emacs
Emacs is a general­purpose, screen­oriented text editor that has been
around for many years and exists, in various manifestations, on OpenVMS
clusters, on most of the Sun workstation groups, and on various
microcomputers, including the Apple Macintoshs, Amigas, and MS­DOS
compatibles. Some of the more common versions of Emacs that you'll find
at the Institute include UniPress Emacs, GNU Emacs, and MicroEmacs.
Each implementation of Emacs works basically the same but with some
differences. The editor is easy to customize, but you may wish to resist the
temptation for portability's sake.
Commands typically have names like ``split­current­window,'' but the
most common commands are bound to a sequence of keystrokes, which
typically include the and keys. The set of bound commands
can be modified and built­in commands extended using macros.
When working with Emacs, each file has an associated buffer so that
when you switch documents your editing session is retained. Each window
has an associated mode line containing the name of the file being edited in
that window.
Ctrl Esc

Emacs 81
Setting Up Each Version
Before you can use Emacs, the symbolemacs must be defined in your
LOGIN.COM file. To use Gnu Emacs, add the following line to your
LOGIN.COM file:
$ @SYS$LOCAL:[GNUEMACS]EMACS
This line will define the symbolEMACS and the logical names that Gnu
Emacs uses. To use MicroEmacs, add the following line to your
LOGIN.COM file:
$ EMACS :== $SYS$LOCAL:[MEMACS]MEMACS
The symbols for Unipress Emacs are defined in the system login file, so
you do not have to change your LOGIN.COM file if you want to use
Unipress Emacs. To edit a file with Emacs typeEMACS followed by the file
name. Gnu Emacs and Unipress Emacs are run askept editors on VMS.
This means that Emacs is run in a subprocess. The first time you run Emacs
the subprocess is created. Each subsequent time you run Emacs, the same
subprocess is run. This speeds the starting of Emacs after the first run.
Learning Emacs
GNU Emacs has printed manuals---with reference cards---available in
the Institute's Science Software Support Office. It also has an online help
facility and introductory tutorials. There are, however, a few functional
differences among the various versions of Emacs. Quick reference cards
are also available in Appendix A.
The online tutorials are a good way to learn Emacs. To use the tutorial:
. Start GNU Emacs and press ­ .
. If you get a message telling you to press , then press .
. Exit from the tutorial by pressing ­ then ­ .
. The online documents are available by typing ­ .
If you prefer to use MicroEmacs (which is smaller and faster than GNU
Emacs), you can run a tutorial by typing:
$ TEACHEMACS
This command starts the editor and loads a document that describes Micro­
Emacs and its functions.
Online help is also available by typing:
$ HELP @SITEHELP EMACS
Ctrl H T
Meta Esc
Ctrl X Ctrl C
Ctrl H I

82 Chapter 4: Editing Files
Key Bindings and Commands
Emacs commands have names like ``next­page'' and ``previous­page.''
These commands provide all of the functions of Emacs, and even though
you may think you're pressing ­ to see the next page of a file, that
keystroke is actually mapped to the command ``next­page.'' These
keystroke bindings are stored in a table that can be modified, allowing a
user to customize the editor.
MicroEmacs has fewer key bindings than the other versions due to its
leaner nature. Keep in mind that any command can be executed in Emacs,
regardless of whether it has a corresponding mapped keystroke. To invoke
an unmapped command, press ­ . This will drop you to a line at
the bottom of your terminal screen in which you can directly enter the
command name. Once you type the command, press to execute the
command.
If you want to see how your keys are initially bound, you can type the
command examine­bindings. Look for ­ and ­
because these are the keys you need to rebind (see the next section)---you
will certainly have to rebind the commands ``search­forward'' (GNU),
``isearch­forward'' (MicroEmacs), ``save­buffer'' (GNU), and ``save­file''
(MicroEmacs).
Flow Control Problems and Startup Files
One problem that you will encounter when using Emacs at the Institute
is that VMS reserves the ­ and ­ keys for flow control
(i.e., ­ suspends output from flowing to the terminal screen and
­ resumes it) so these keys cannot be used in Emacs key bindings.
However, the default bindings for several of the most common commands
include these keys. The solution is to rebind these commands in the startup
file. The startup file is placed in your login directory and contains Emacs
commands that are executed when you start the editor. The command
format and name of the startup files are different for each of the versions of
Emacs. The sample files shown in Figure4.6 contain commands which
unbind the ­ and ­ keys and rebind the save file and
search commands to ­ and ­ respectively.
Ctrl V
Esc X
Return
Ctrl S Ctrl Q
Ctrl S Ctrl Q
Ctrl S
Ctrl Q
Ctrl S Ctrl Q
Ctrl X S Esc S

Emacs 83
Gnu Emacs startup file (.EMACS)
(global­unset­key ``\C­s'')
(global­unset­key ``\C­q'')
(global­set­key ``\C­xs'' `save­buffer)
(global­set­key ``\M­s'' `isearch­forward)
Micro Emacs startup file (EMACS.RC)
unbind­key ^S
unbind­key ^Q
bind­to­key save­file ^XS
bind­to­key search­forward M­S
Unipress Emacs (.EMACS_PRO)
(remove­binding ``\^S'')
(remove­binding ``\^Q'')
(bind­to­key ``write­current­file'' ``\^Xs'')
(bind­to­key ``search­forward'' ``\033s'')
Figure 4.6: Redefining Emacs Key Bindings
Basic Functions
Like any text editor, Emacs has a wide range of commands. In Emacs
there are two ways to execute a command:
. Type the command name in the command buffer.
. Type the control key sequence that is bound to the command.
These control key sequences are either single control keys, or two­key
sequences, usually beginning with ­ or . To execute a
command in the command buffer, first press ­ , type the command
name in the buffer, and press . To abort a partially entered command,
either in the command buffer or in a two key sequence, press ­ .
A list of basic commands and their key mappings is shown in T
able 4.4.
Ctrl X Esc
Ctrl X
Return
Ctrl G

84 Chapter 4: Editing Files
Table 4.4: Basic Emacs Command Sequences
Search and Replace
The ``search­forward'' command in Emacs is one that must be remapped
to ­ . When you enter the keystroke to search, the cursor drops to a
message line at the bottom of your screen. In the message line you should
enter the text that Emacs should seek followed by . To find the next
occurrence of a string, you would type ­ .
The search and replace function--- ­ ---will do a global search,
replacing all occurrences of the old text with the new text. You can have
Emacs query you before making any changes by using the ``query­replace''
command, ­ (UniPress) or ­ (MicroEmacs). Each time
Function GNU Emacs MicroEmacs UniPress
Read File ­ ­ ­ ­ ­ ­
Write File ­ ­ ­ ­ ­ ­
Insert File ­ ­ ­
Exit Editor ­ ­ ­ ­ ­
Next Page ­ ­ ­
Previous Page ­ ­ ­
Start of Line ­ ­ ­
End of Line ­ ­ ­
Search Forward ­ ­ ­
Search Backward ­ ­ ­
Delete Line ­ ­ ­
Undelete ­ ­ ­
Two Windows ­ ­ ­
One Window ­ ­ ­
Other Window ­ ­ ­
Ctrl X Ctrl F Ctrl X Ctrl R Ctrl X Ctrl R
Ctrl X Ctrl S Ctrl X Ctrl S Ctrl X Ctrl S
Ctrl X I Ctrl X I Ctrl X I
Ctrl X Ctrl C Ctrl X Ctrl C Ctrl C
Ctrl V Ctrl V Ctrl V
Esc V Ctrl Z Esc V
Ctrl A Ctrl A Ctrl A
Ctrl E Ctrl E Ctrl E
Ctrl S Ctrl S Ctrl S
Ctrl R Ctrl R Ctrl R
Ctrl K Ctrl K Ctrl K
Ctrl Y Ctrl Y Ctrl Y
Ctrl X 2 Ctrl X 2 Ctrl X 2
Ctrl X 1 Ctrl X 1 Ctrl X 1
Ctrl X O Ctrl X O Ctrl X N
Esc S
Esc
Esc S Esc
Ctrl R
Esc Q Esc R

EDT 85
an occurrence is found, you will be prompted to enter one of the following
options:
. y ­ Make the replacement
. n ­ Do not replace, continue search
. ­ ­ Abort replacement process
. ? ­ List options
Search functions work slightly different in GNU Emacs. The search
function is ``incremental­search'' rather than ``search­forward.'' After
pressing ­ each character you enter is immediately added to the
search string and is sought. You do not need to press at the end of the
string, in fact, if you do press it, the search aborts.
EDT
EDT was, for many years, Digital's default editor. Although it is still
available, it is no longer supported. EDToperates in three modes:
. Keypad mode .
. Line mode.
. Nokeypad mode.
Most users will only use keypad mode (which is the interactive screen
editing window) and line mode (the mode you're in when you start up
EDT).
Starting EDT
EDT is invoked by typing:
$ EDT filename
Ctrl G
Esc S
Esc

86 Chapter 4: Editing Files
This puts you into line mode. To interactively edit the text, you want to
be in keypad mode. The table below lists the same commands available in
line mode; these commands can be abbreviated to only their first letter.
Table 4.5: EDT Line Mode Commands
To switch modes, type c (for ``change'') at the asterisk prompt, for
example:
$EDIT/EDT NEWFILE.TXT
*c
Basic Editing
Once you're in the keypad mode, you can move through the file using
the arrow keys. After modifying your file, press ­ to get back into
line mode. If you want to save changes and quit, typeexit at the asterisk
prompt. If you want to ignore the changes, typequit.
In keypad mode, most commonly­used commands are invoked by
pressing one or more keys on the numeric keypad. Many functions are
invoked by first pressing the key, (which is defined as the key
on VT100­type terminals). Figure4.7 shows the editing functions that are
mapped to a VT100 numeric keypad. The function at the top of the key is
executed when you press the key itself, the function at the bottom of the
key is executed when you press before the key. If you have a VT200
or VT300­series terminal, the keys are mapped identically, but there are
additional keys to the left of the keypad that you can use. See Figure4.8.
Command Purpose
EXIT Save changes and quit EDT
QUIT Quit EDT without saving changes
HELP List available commands
CHANGE Go into keypad mode
number Go to a specific line number
Ctrl Z
Gold PF1
Gold

EDT 87
Figure 4.7: VT100, VT200, or VT300 Keypad Layout for EDT
Figure 4.8: Additional EDT Keys on VT200 or VT300
Help
Help is available from within keypad mode by pressing . EDT is
also described in Chapter9 of the OpenVMS User's Manual.
UP DOWN LEFT RIGHT
PF1 PF2 PF3 PF4
7 8 9 ­
4 5 6
1 2 3
0 .
,
Enter
GOLD HELP
FINDNXT
FIND
DEL L
UNDEL
PAGE
COMMAND
SECT
FILL
APPEND
REPLACE
DEL W
UNDEL W
ADVANCE
BOTTOM
BACKUP
TOP
CUT
PASTE
DEL C
UNDEL C
WORD
CHGCASE
EOL
DEL EOL
CHAR
SPECINS
ENTER
SUBS
LINE
OPEN LINE
SELECT
RESET
Help Do
Find
Insert
Here Remove
Select
Prev
Screen
Next
Screen
PF2

88 Chapter 4: Editing Files
Recovering a Journal File
During an editing session, EDT creates a temporary journal file
containing every keystroke entered during a session. This file is usually
discarded when you close the edited file, but it can be explicitly saved. The
journal file enables you to recover whatever work you did on a file if some
type of system interrupt occurs during the session. Because journal files are
not continuously updated---only incrementally updated---the last few
editing commands or keystrokes may not always be saved, but the bulk of
the session will be recoverable.
Journal files have an type of . JOU. For example, if you are editing a file
called MYPAPER.TXT, during your editing session, there will be a
temporary file called MYPAPER.JOU. If you want to save the journal file
when you exit from the editor, you would type (from the command mode):
* exit/save
If you have the misfortune to be in the middle of an editing session
when the system crashes, your session can be recovered by typing the
following command (you would, of course, replace specify your own file
name instead of ``MYPAPER.TXT''):
$ EDT/RECOVER MYPAPER.TXT
It is wise to save the file immediately after recovering your editing
session because after recovering the file, the journal file is deleted.
When you recover files, specify the name of theoriginal file---not the
journal file.
Language Sensitive Editor: LSE
The VAX Language Sensitive Editor, also known as ``LSE,'' can only be
used on VT100, VT200, and VT300 series terminals---or terminals with
VT100 or VT200 emulation. LSEDIT is a full­screen editor with the
following capabilities:
. Includes templates for many programming languages. 3
3. For information about using LSEDIT with LaTeX files, see Chapter 4 of the
STScI Software Guide.

Language Sensitive Editor: LSE 89
. Supports windowing.
. Compiles and debugs code from within editor.
. Provides programmable editing functions.
. Uses EDT default keypad layout.
Commands
Table 4.6 describes some of the more common LSE commands.
Additional information is available in the online help library. From the
system prompt, type HELP LSE.
Table 4.6: LSE Commands
Command Description
CUT/BUFFER name Cuts selected text from file and writes it to buffer
name
GOTO BUFFER name Edit text in buffer name
SHOW BUFFER List all buffers; buffers can be deleted or selected
from the menu
SET WRITE/BUFFER=name Cut text buffers are not written to disk unless this
command is used to enable writing
GOTO FILE filename Reads a file into a buffer
DEFINE KEY/LEARN key Define key; press ­ (from keypad) to
get LSE prompt (on a VT200 or VT300 terminal,
press )
QUIT Quit LSE without saving changes
EXIT Quit LSE after saving changes
HELP Display LSE help facility
Gold 7
Do

90 Chapter 4: Editing Files
Spell Checkers
There are two spell checkers on the VMS clusters: the SPELL
command and the TEXSPELL command. SPELL is a general­purpose
spelling checker, while TEXSPELL is specifically intended for use with
TEX or L A TEX source files. This section describes only SPELL;
information about TEXSPELL is provided on page101.
The SPELL command checks the spelling of all words in a standard text
file. Keep in mind that the program will not always catch every misspelled
word, and it will sometimes flag correctly spelled words as incorrect.
Proper nouns, technical terms, and abbreviations will usually be flagged as
incorrect unless you provide a list of these terms in a separate word file.
The command is normally invoked as follows:
$ SPELL filename
An optional personal dictionary file can be included, which can contain
any proper names or abbreviations. To make your own word file you would
use a standard editor, such as DECTPU, to create a text file with the type
.TXT. The text file must conform to the following rules:
. No lower­case letters.
. No special characters.
. One word per line.
. No blank lines.
. No spaces.
After creating the word file, you would type the command as follows:
$ WORDS your_word_file.txt personal_dictionary.wrd
This creates a word file with the type .
WRD. Now you're ready to run
SPELL. To use your own personal dictionary, you would enter the
following command:
$ SPELL file_to_be_checked personal_dictionary.wrd

Other Text Tools 91
Other Text Tools
SEARCH
The SEARCH command finds text strings in files and displays any lines
it finds that match the text string. Two arguments are used: the filenames to
be searched and the text strings to be found; wildcards and lists of files can
be used to search multiple files, and several text strings can be
simultaneously matched---each string is separated by a comma. For
example, to find the string ``AGN'' in all T EX source files in the current
directory, you could use the command:
$ SEARCH *.TEX AGN
If you wanted to look for complex strings with embedded blanks, you
need to use quotes. The /WINDOW qualifier specifies the number of lines to
be displayed before and after the text string. For example:
$ SEARCH *.TXT "WEEKLY REPORT 12" /WINDOW=(2,1)
Instead of having the text lines in which the strings are found displayed
to your screen, you may want to save the results in an output file. Y
ou can
do this using the/OUTPUT qualifier. For example:
$ SEARCH/OUTPUT=RESULTS.TXT *.TEX Weekly,Monthly
A number of other qualifiers are available to help you restrict your
search, for example, by file owner or file creation date. Information about
these features are available in the online help files by typing:
$ HELP SEARCH
A simple example of how the SEARCH command could be used is
shown in Figure 4.9.
Figure 4.9: Finding Text with SEARCH
$ search *.TXT fee
******************************
DISK$USER9:[MSTEVENS.TEST]MEMO1.TXT;1
Please send a note to Fee Waybill in the Tube department
so please contact Fee by close of business Monday.
******************************
DISK$USER9:[MSTEVENS.TEST]MEMO2.TXT;2
Please send a note to Fee Waybill in the Tube department
so please contact Fee by close of business Monday.
$
Occurrences found
are highlighted
Search is not
case sensitive

92 Chapter 4: Editing Files
DIFFERENCE
The DIFFERENCE command can be used to compare two files and find
lines that do not match. This can be especially useful, for example, for
finding out what changes were made between two versions of the same file.
While DIFFERENCE usually expects two filenames on the command line,
by specifying only one, the program compares the two highest versions
with the same file name.
You can save the output from DIFFERENCE to a file by using the
/OUTPUT qualifier. You can either specify a filename in which differences
should be saved, or the program uses the rootname of the first file being
compared and appends a file type of .
DIF. The following example shows
how to use the command, saving results in a file calledOUT.DIF:
$ DIFFERENCE/OUTPUT=OUT.DIF FILE1.TXT FILE2.TXT
Options are also available to have the program display the files side by
side, in hexadecimal format, to search only a limited number of lines, to
include line numbers or change bars in the output, and other functions.
These options and the qualifiers used to enable them are described in the
online help.
Figure 4.10 shows an example of how theDIFFERENCE command can
be used to compare two text files.
Figure 4.10: Comparing Two Files with DIFFERENCE
$ difference memo1.txt memo2.txt
************
File DISK$USER9:[MSTEVENS.TEST]MEMO1.TXT;1
5 This year's comany picnic will be at Rndlph Whart in
6 Cecil County. Food and drink will be provided for all
******
File DISK$USER9:[MSTEVENS.TEST]MEMO2.TXT;2
5 This year's company picnic will be at Rudolph's Wharf in
6 Cecil County. Food and drink will be provided for all
************
************
File DISK$USER9:[MSTEVENS.TEST]MEMO1.TXT;1
11 telling him how many people you are bringing. We ned
12 to give a count of people to the caterer by next Tuesday
******
File DISK$USER9:[MSTEVENS.TEST]MEMO2.TXT;2
11 telling him how many people you are bringing. We need
12 to give a count of people to the caterer by next Tuesday
************
Number of difference sections found: 2
Number of difference records found: 2
DIFFERENCES /IGNORE=()/MERGED=1­
DISK$USER9:[MSTEVENS.TEST]MEMO1.TXT;1­
DISK$USER9:[MSTEVENS.TEST]MEMO2.TXT;2
$
Lines as they appear
in first file
Lines as they appear
in second file