How about using `replace-regexp`, which contains optional arguments for `START` and `END`? To control lazy highlighting while the search is being performed, the variable `query-replace-lazy-highlight` can be customized or let-bound to the desired setting; e.g., `nil` for no lazy highlighting. See also the variables `lazy-highlight-initial-delay` and `lazy-highlight-interval`. <!-- language: lang-lisp --> (defun chikan () "Doc-string." (interactive) (replace-regexp "\\<ichi\\>" "one" nil (point-min) (point-max)) (replace-regexp "\\<ni\\>" "two" nil (point-min) (point-max))) Rather than using word boundary delimiters in the first argument as depicted in this example, see the optional argument in `replace-regexp` for DELIMITED which contains a doc-string entry as follows: "*Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace only matches surrounded by word boundaries. A negative prefix arg means replace backward.*" For an answer that deals with regexp matches that excludes surrounding word constituents, see https://stackoverflow.com/a/5941448/2112489 , the text of which is copied hereinbelow for convenience: The regexp `\<foo\>` or `\bfoo\b` matches `foo` only when it's not preceded or followed by a word constituent character ([syntax code](http://www.gnu.org/software/emacs/manual/html_node/emacs/Syntax.html) `w`, usually alphanumerics, so it matches in `foo_bar` but not in `foo1`). Since Emacs 22, the regexp [**`\_<foo_bar\_>`**](http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Backslash.html) matches `foo_bar` only when it's not preceded or followed by a symbol constituent character. A symbol constituent is either a word constituent or a character with syntax `_`. Most programming mode define `_` to be a symbol constituent.