Suppose you visit a file F in an emacs buffer B, let r and R be some replacement regular expressions. Now I want to replace all occurrences of strings r_i which matches r (in some region) by the corresponding replacement-string R_i defined by R such that the following conditions are fulfiled:
- if I save F, the above replacement must not change the content of F
- if the cursor is over some text which was replaced via R, it should show the original r_1, which matched r. If I do this, edit r_1 to r_2 and move the cursor away, r_2 should be replaced by the corresponding R_2 iff it matches r.
It would be nice if it would be possible to highlight (e.g. different color, or underline ...) the replacements and control this highlighting depending on r.
I guess that such a functionality already exists but I don't know how it is called. What I described above is in some way similar to preview mode for editing latex-files.