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.

  • 1
    If you do not see the same problem when starting Emacs using emacs -Q (no init file) then recursively bisect your init file to find the culprit. You can do that using command comment-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.
    – Drew
    Aug 28, 2017 at 23:14
  • Drew, thanks very much showing me this debug technique. WIll try it later.
    – pokeba
    Aug 29, 2017 at 19:29

1 Answer 1


By following Drew's suggested debug approach, I was able to identify the package/code that caused this issue. It is caused by an out-of-date flash-paren.el. I loaded the most up-to-date version and the issue was fixed.

Thanks very much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.