bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45617: <query-replace> loses the edit region. Works in 23.3, broke i


From: Juri Linkov
Subject: bug#45617: <query-replace> loses the edit region. Works in 23.3, broke in 26.3
Date: Mon, 25 Jan 2021 20:54:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> It was doing the expected, correct, query replace, for the first, oh, maybe
> six times, then got into the broken state and when I repeat the above
> sequence it behaves as if there was no region selected and no replacements
> are offered (Replaced 0 occurences).

This is strange because if there is no region selected, this means that
it should replace everywhere in the whole buffer (but only when point is
at the beginning of the buffer).

> It seems like something was not restored correctly. I cannot say I precisely
> followed the above steps for the first times when it was working - I wanted
> to vary the sequence a bit (sometimes entering from the keyboard, sometimes
> selecting text from a lower line in the selection) to see if I could break
> it. I cannot be more specific about exactly which sequence broke it, only
> that now, when it's broken, it consistently does not work!

It could help you to debug when you insert the following line
in 'query-replace' immediately before the 'perform-replace' call:

  (message "region: %S %S" start end)

Then after query-replace you could check in the *Messages* buffer
and see the exact region boundaries used.  If there are 'nil' values,
this might mean there is a bug in save-mark-and-excursion.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]