Assignment 7.doc

advertisement
CST 334
ASSIGNMENT 7
App C
Due: Next Monday
Problem I. Do the following lab activity:
1. in Unix, open a file using Emacs for editing:
2. Enter text into the work buffer:
cherry blossoms, more
and more now! birds have two legs!
oh horses have four!
emacs haiku
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
Save file
Leave the editor
Reopen the file using Emacs
Use the arrow keys to move the cursor
Use the alternative cursor control keys to move the cursor
Replace text: move the cursor to b in birds, then delete birds
Now type
Save and exit Emacs
Reopen the file using Emacs
Move the cursor to the bottom of the file
Now type the following lines:
This dewdrop world
is a dewdrop world
and yet, and yet
C-x C-s
C-x C-c
emacs haiku
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
Save the file but do not exit
Move the cursor to the beginning of the line "this dewdrop"
Delete the line:
Yank (paste) the line back where it was
Move the cursor to the beginning of file
Yank (paste) the same line again:
undo your changes
Quit without saving the file
Go back into Emacs don't give a file name
Open the file haiku from Emacs
Move the cursor to the beginning of cherry
Set a mark in the file
Move the cursor to the line following "four!"
Delete the region
Move the cursor to the end of the file and press enter
Yank (paste) the poem you just deleted
Move the cursor to the beginning of the file
Search for the word and (this is an incremental search)
Find the next occurrence of and
Go back to the top of the file:
Start a global replace, changing all s's to t's
Confirm each change:
Automatically do all changes:
Save to a different file
Quit emacs
C-x C-s
C-b, C-f, C-n, C-p
C-d (each letter )
camels
C-x C-c y (to save)
emacs haiku
M->
C-k C-k
C-y
M-<
C-y
C-_ (can repeat)
C-x C-c n (don't save)
emacs
C-x C-f haiku
C-spacebar
C-w
M-> enter
C-y
M-<
C-s and
C-s
M-<
M-% s (enter) t (enter)
Spacebar
!
C-x C-w haiku_mod
C-x C-c
Problem II. Do the following Lab Activity:
1.
2.
3.
4.
5.
6.
7.
8.
Copy the file stall.txt in the cst334 directory to your home directory.
Open the file in Emacs
Delete the email header information (Lines 1-9) by setting a mark and using the C-W command
Using the global replace command delete the " > " symbol at the start of each line (do this by
replacing "> " with nothing in the replace field)
Using the global replace command, change all occurrences of Stallman to "St IGNUcius"
Separate each paragraph with an extra line break after each short line
(there should be 7 paragraphs in the main text starting with BRUSSELS)
Using the ESC q paragraph reformat command, clean up the ragged edges of all 7 paragraphs
Save the text to a new file named stignu.txt
Problem III.
Combine (cat) the files haiku, haiku_mod, and stignu.txt into a single file called
as7.txt
I will collect these electronically on the due date.
Download