The query-replace command used to work perfectly for me. Recently, it fails with a symptom like this:
[updated] Assuming the code looks like: (for example)
Now I issued the command "M-x query-replace[RET]flaag[RET]flag[RET]" It highlights all the "flaag" in the screen, note the cursor will be on '(' of first line after high-lighting the first "flaag" in line 1. Then as soon as I typed a 'y' to proceed, it puts the 'y' in the buffer and quit without replacing "flaag" to "flag". (So line 1 looks like "set_flaagy(var1)".)
If I change the command to: "M-x query-replace[RET]flaa[RET]fla[RET]". This way the cursor will be on the letter 'g' instead of '(' after highlight the matching parts in line 1. And the command works correctly.
I guess may be some of my new settings in init.el may have screwed up something. But I have no clue how to resolve/debug this issue. Would appreciate a help.