Julien Palard

Python Developer and Trainer

Searching and replacing in emacs

Day two of my serie about emacs, about searching and replacing.

isearch-forward let you type a string to be searched incrementally in the current buffer, successive following C-s will jump to the next match.

isearch-forward-regexp let you type a regexp to be searched incrementally in the current buffer, successive following C-s will jump to the next match.

Then, for each term found, query-replace will ask you what to do: space or y to replace, delete or n to skip, RET or q to exit, ! for "yes for all", ? to get help about how to enter recursive edit / delete match and recursive edit / edit replacement string / ... Then you should read about replace-string, replace-regexp, occur, list-matching-lines, multi-occur, multi-occur-in-matching-buffers, how-many, flush-lines, and keep-lines.

Case sensitivity: A search is by defaut case insensitive, but if you input an upper case letter, it become case sensitive. M-c during a search toggle the case sensitivity. Configuration variables: You may consult the documentation about those variable typing : C-h v *variable* or M-x apropos-variable RET case-fold-search RET