next up previous
Next: Backup files and recovering Up: emacs Previous: Searching incrementally

Replacing selectively

The query-replace command searches for a string in the buffer and gives you the option to replace it or ignore it. Start the command with M-%. You will then be prompted for the search string. Type it and hit Return. Then you will be prompted for the replacement string. Type it and hit Return. Starting from its current position, the cursor then jumps to the next match in the buffer. Emacs then waits for a signal to tell what to do next. Here are some of the several options:

The last one may be the one you want to remember first!



Carleton DeTar 2016-12-29