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)
set_flaag(var1);
set_flaag(var2);
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.
emacs -Q
(no init file) then recursively bisect your init file to find the culprit. You can do that using commandcomment-region
(C-u
uncomments): Comment out 1/2 your init file, then 3/4, 7/8, 15/16, etc., to narrow it down to the problematic code. This is quick to do because it is a binary search.