Emacs 23.3 is said to allow prompting part of the replacement string on each match, via the \?
syntax.
The string should be prompted in the mini-buffer.
This feature is described here: http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html
I tried the simple replacement (query-replace-regexp "^" "\\?")
with Emacs 23.3 on Windows, but I get a "Invalid use of `\' in replacement text" error.
Any idea on how I should use this feature ?
Note: I could use \,(read-from-minibuffer "? ")
instead but doing so prompts for a string before highlighting the match.
I don't think it matters, but my version of Emacs is the following: GNU Emacs 23.3.1 (i386-mingw-nt6.1.7601).
This is a feature of replace-regexp
, not query-replace-regexp
. (Didn't know about this feature; thanks for highlighting it!)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With