benma / visual-regexp.el

A regexp/replace command for Emacs with interactive visual feedback
400 stars 29 forks source link

wrong-type-argument markerp nil #43

Closed CyberShadow closed 8 years ago

CyberShadow commented 8 years ago
echo -n '"' > a
emacs -Q -l visual-regexp.el a
M-x vr/replace
"\(a\)?\(\)
RET
RET
Home
M-x vr/replace
Up

Step 4 is including the leading double quote.

BTW, at step 5 it shows "1 matches" but after step 6 it shows "replaced 0 matches".

benma commented 8 years ago

Thanks for the report. I pushed a fix, please let me know if it works.

Out of curiosity: how did you come up with the trailing empty group? I can't think of a practical use. Without it, the error did not occur.

CyberShadow commented 8 years ago

I pushed a fix, please let me know if it works.

It does, thanks!

Out of curiosity: how did you come up with the trailing empty group? I can't think of a practical use. Without it, the error did not occur.

I reduced the regular expression from a more complex one: "\(if \(.*\)?, \)?\(.*?\). I've confirmed that the fix works with the longer expression as well.