Searching locates text; it does not change the text. Editing happens at point, which is after the match when a forward search succeeds. We will make one small insertion, inspect it, and undo it before attempting a replacement.
ready. When the search finds the word,
press RET to finish. Point is after ready and before its full stop.
now. C-e l should read the sentence with
ready now. The other sentences are unchanged.
undo-only again and inspect again. Undo works in editing
groups, not necessarily one character at a time. Stop when the sentence
is back to This sentence is ready.; do not undo the original example.
Use undo-only for this listen-between-steps pattern: after an intervening
reading command, ordinary C-/ can redo an earlier undo instead.
notebook from the beginning and finish with RET. Notice that
searching and reading did not modify the document. You can return to any
known phrase without counting lines.
If a search does not find its text, check your spelling. C-g during a failing search first backs out of the failure; another C-g may be needed to leave the search. Wait until the search prompt is gone before typing ordinary text. A successful search is accepted with RET, not by typing the edit into its search prompt.
2A. Replace green with blue. Use a successful search for the whole word,
then M-DEL to remove the word immediately before point, and type its
replacement. Here DEL means Backspace; M-x backward-kill-word RET is an
alternative to M-DEL. Inspect the complete line and restore green before
continuing.
2B. What would happen if you typed now before accepting the search?
Explain the difference between changing the query and changing the document.
See Answers for lesson 2. Text undo is not a general undo command for settings menus; we will practise their recovery separately. For more on inspecting between undo steps, see Recover a text edit before saving and Undo in the GNU Emacs Manual.