I have a sporadic error when running query-replace
:
Args out of range: #<buffer lib.rs>, 0, 1
There are similar questions:
- Match data clobbered by buffer modification hooks
- (RegEx-)Replace: Sporadic Match data clobbered by buffer modification hooks
These point towards the problem being that something is overriding the match-data during the find-and-replace operation, but it's difficult to identify exactly what.
Is it possible to log to a buffer or enter the debugger any time that the match-data is modified? Is there another technique to identify what is clobbering the match-data, before I resort to line-by-line printf
style debugging? Bisecting my init file would tell me what package I'm using is misbehaving, but not where the misbehavior occurs.
I've seen Tracking down a write to a variable, but that doesn't appear to apply to match-data
, which is a function, not a variable. I've also seen How do I debug when match-data is not getting set?, which appears to be the opposite problem from mine.