home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 49
/
Amiga_Dream_49.iso
/
atari
/
texte
/
oribin.zoo
/
learn
/
search
< prev
next >
Wrap
Text File
|
1991-06-28
|
2KB
|
52 lines
SEARCHING
---------
Origami can do searches for strings (these are groups of contiguous
characters or words) either forward through the file or backward through
it.
>> Now type C-S to start a search. Type the word "cursor", then <return>.
>> Go a few characters forward, then type C-S <return> to find the next
occurrence of "cursor".
The C-S starts a search that looks for any occurrence of the search string
AFTER the current cursor position. But what if you want to search for
something earlier in the text? To do this one should type C-R for
search-reverse. Everything that applies to C-S applies to C-R except that
the direction of the search is reversed.
You may or may not know this kind of searching, but usually you will use
another searching capability in Emacs, which is typical for it. It is
called incremental-search, because Origami searches while you are typing the
item.
>> Type C-X s to start incremental searching. When I-search appears,
type in the word "comma". Note what happens with the cursor while
typing. Now add "nds" and again note what happens. Delete the "s".
Type RETURN.
If you want to jump to the next occurence of the typed item, type C-S. C-R
will switch to backward searching. ENTER ends incremental searching and
leaves the cursor at the current position, whereas aborting with C-G brings
you back to the original position. If you want to start searching
backwards, type C-X r.
TEXT REPLACEMENT
----------------
>> Move the cursor to the blank line two lines below this one. Then type
M-r changed <return> altered <return>.
Notice how this line has changed; you have replaced the word "changed"
with "altered" wherever it occurs in the file after the cursor. After all
the substitutions have been made or the end of file has been reached, a
message informing you of the number of substitutions which have been made
appears in the communication line.
The more customary command for replacing strings is the interactive command
query-replace-search (M-C-R), which has several options. In essence, it
shows each occurrence of the first string and asks you if you want to
replace it or not.