13.12.3 Replacing text

You can search for text and replace it with other text using the
Edit > Replace... menu item. Type a string to search for and a string to replace it with in the Replace dialog that appears, and click
Find Next
. The cursor is placed immediately after the next occurrence in the current buffer of the string you specified. To replace this occurrence and locate the next one, click
Replace
. To leave this occurrence as it is and locate the next one, click
Find Next
. Note that this type of searching is
not
incremental.

For instance, assume you wanted to replace every occurrence of "equal" to "equalp".

Choose
Edit > Replace....

The Replace dialog appears.

Type
equal
in the
Find what
box:

Type
equalp
in the
Replace with
box and click
Find Next
.

The search will stop at every occurrence of "equal" after the current cursor position:

If you want to replace this occurrence, click
Replace.

If you do not want to replace this occurrence, click
Find Next
.

If you want to replace this occurrences and all later occurrences, click
Replace All
.

If you want to abandon the operation altogether, click
Cancel
.

Note:
Both
Edit > Find... and
Edit > Replace... start searching from the current position in the buffer. When the end of the buffer is reached, you are asked whether to start again at the beginning. To start from the top of the buffer initially, check the
From Top
option before searching.