Subject: bug#31492: 26.1; query-replace-regexp undo fails in regexps w/o printable chars

From: Tino Calancha <[email-masked]>
Date: Sat, 19 May 2018 10:46:10 +0900 (JST)

On Fri, 18 May 2018, Eli Zaretskii wrote:

>> From: Tino Calancha <[email-masked]>
>> Date: Fri, 18 May 2018 23:22:13 +0900 (JST)
>> cc: Tino Calancha <[email-masked]>, [email-masked]
>>
>>>> emacs -Q
>>>>
>>>> < C-M-% \b RET foo RET TAB TAB TAB
>>>> U ; undo all replacements
>>>> ;; Nothing is undid :-(
>>>
>> '<' stands for `beginning-of-buffer'.
> Sorry, I'm still in the dark. Typing '<' inserts that character
Opps... Sorry!  That should read 'M-<'.
And the TAB's should read SPC.

The correct recipe is:

M-<
C-M-% \b RET foo RET SPC SPC
U
;; All 'foo' keep there :-(

This happen because the regexp "\b" has any printable character.
If we try instead:

M-<
C-M-% is\b RET foo RET SPC SPC
U
;; Now all 'foo' are gone :-)