Questions tagged [query-replace]
query-replace is a built-in Emacs command for interactively replacing one string with another in a buffer. query-replace-regexp does the same thing, but with support for matching regular expressions. Use this tag for both commands.
87 questions
0 votes
1 answer
66 views
Using query-replace to add text properties to replacement strings in Emacs
I'm trying to use query-replace in Emacs to replace a string with another string that has specific text properties. Specifically, in this example, I want to replace occurrences of "foo" with ...
0 votes
1 answer
108 views
query-replace: ignore events not binded in query-replace-map
I have this function: (defun my-replacements () (interactive) (query-replace "foo" "bar" nil (point-min) (point-max)) (query-replace "baz" "quz" nil (...
0 votes
1 answer
38 views
How can I get `query-replace` to respect `superword-mode`?
I'm trying to use query-replace with a prefix argument in superword mode. So for example, C-u M-% token RET token_drawer RET should not replace token where it appears in token_width. But query-...
0 votes
1 answer
118 views
query-replace bug?
When I run query-replace* commands if I type ? I get this explanation of the function's options: Type Space or ‘y’ to replace one match, Delete or ‘n’ to skip to next, RET or ‘q’ to exit, Period to ...
0 votes
1 answer
130 views
How can I recursively find and replace text in case sensetive?
I am using combination of following solutions in order to find-and-replace matched text in all Python files: Using Emacs to recursively find and replace in text files not already open How can I ...
1 vote
1 answer
237 views
How can I replace all in symbol manner?
I am using following solution (How do I add a keybinding to use during an interactive isearch, `C-s ...`) to move over symbols in the buffer, which iterates over the matching symbols: (define-key ...
0 votes
1 answer
91 views
Find and recursively delete (with query) consecutive duplicate words not necessarily in the same line and/or same case
I would like to scan through a (latex) document and recursively delete -- WITH QUERY -- all consecutive, repeated words that need not be on the same line and/or the same case. Here is a simple ...
0 votes
0 answers
169 views
Why doesn't project-query-replace-regexp work well
It seems promising to have a built-in function that performs this action: find and replace all matching text recursively, within your project. The problem is that it doesn't seem consistent. I am ...