When I run query-replace*
commands if I type ?
I get this explanation of the function's options:
Type Space or ‘y’ to replace one match, Delete or ‘n’ to skip to next,
RET or ‘q’ to exit, Period to replace one match and exit,
Comma to replace but not move point immediately,
C-r to enter recursive edit (C-M-c to get out again),
C-w to delete match and recursive edit,
C-l to clear the screen, redisplay, and offer same replacement again,
! to replace all remaining matches in this buffer with no more questions,
^ to move point back to previous match,
u to undo previous replacement,
U to undo all replacements,
E to edit the replacement string.
In multi-buffer replacements type ‘Y’ to replace all remaining
matches in all remaining buffers with no more questions,
‘N’ to skip to the next buffer without replacing remaining matches
in the current buffer.
I often use comma
to check the replacement. It happens that, some times, I get the error (e.g.):
match-substitute-replacement: Args out of range: #<buffer *scratch*>, 1667, 1679
The error doesn't happen if I type y
(or n
)
Try this:
(query-replace ",.\\footnote{" ".\\footnote{" nil)
With the string ",.\footnote{" at the end of the buffer. To see the error "{" must be the last char in the buffer.
(I see often this bug because I use use "narrowing" a lot)
Is it a known bug?
My emacs version is GNU Emacs 26.3.
M-x report-emacs-bug
if there's not an existing bug report for it.emacs -Q
(no init file).-Q
causes Emacs to start without any init files (site or user), so if you can reproduce the bug in such a session, it shows that the bug is really an Emacs bug, rather than an init file bug.