Subject: Re: bug#60823: 28.2; string-rectangle cancel can leave garbage from preview

From: Eli Zaretskii <[email-masked]>
Date: Sun, 15 Jan 2023 09:03:31 +0200

> From: Chris Waters <[email-masked]>
> Date: Sat, 14 Jan 2023 17:00:46 -0800
> 
> Steps to reproduce, starting with 'emacs -Q':
> 
> 1. Go to the scratch buffer OR create a new
> buffer with 'C-x b foo RET'. (Tested both ways.)
> 2. Press 'C-SPACE' or 'C-x SPACE' to set the mark. (Tested both ways.)
> 3. Press RET.
> 4. Press 'C-x r t' (string-rectangle), then type 'foo', but do NOT press
> RET! A preview will appear in the original buffer, showing two instances
> of the string "foo", as expected.
> 5. Press 'C-x o' or click in the main window (tested both ways). This is
> the step which triggers the bug!
> 6. Press 'ESC ESC ESC' to cancel.
> 
> Expected results: the preview instances of the string "foo" in the
> original buffer should disappear, as they do if you skip step 5.
> 
> Actual results: the preview instances of the string "foo" do NOT
> disappear, and cannot be removed by any obvious means. Attempting to
> delete them simply deletes the newlines between them. Nor can you return
> to the minibuffer via 'C-x o'; the string-rectangle command has truly
> been cancelled.

I can reproduce this in Emacs 28, but not in Emacs 29 or 30.  So I
guess we already fixed this bug in some way.  Can you try the
development code in the Emacs Git repository and see if the problem is
indeed solved in your configuration as well?

Thanks.