Emacs: replace regexp with a tooltip in every match

It is reported that Emacs 23.3 allows you to query for a portion of the replacement string in each match through syntax \?.

The string must be requested in the mini-buffer.

This function is described here: http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html

I tried a simple replacement (query-replace-regexp "^" "\\?")using Emacs 23.3 on Windows, but I get the error "Invalid use of error" with text replacement.

Any idea on how I should use this feature?

Note. Instead, \,(read-from-minibuffer "? ")I could use \,(read-from-minibuffer "? "), but it asks for a string before displaying a match.

I don't think this is important, but my version of Emacs is this: GNU Emacs 23.3.1 (i386-mingw-nt6.1.7601).

+5
source share
1 answer

This is a function replace-regexp, not query-replace-regexp. (I didn’t know about this function, thanks for highlighting it!)

+8
source

All Articles