Subject: Re: bug#76997: 31.0.50; Freplace_buffer_contents

From: Eli Zaretskii <[email-masked]>
Date: Thu, 13 Mar 2025 22:22:26 +0200

> Date: Thu, 13 Mar 2025 16:27:13 +0000
> From:  nat chapman via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> under certain circumstances, Freplace_buffer_contents seems to introduce
> gibberish into the buffer. i noticed it in org-mode and followed it to
> Freplace_buffer_contents with debug, then confirmed with git bisect that
> commit 40d8650d517 introduced the problem.
> 
> emacs -Q
> C-x b test RET
> M-x org-mode RET
> 
> #+begin_src emacs-lisp
>   (+ 1 2|)
> #+end_src
> 
> with point at |, two or three RET begins introducing garbage into the
> buffer. sometimes this crashes emacs, but i think that's to do with the
> garbage getting read.

Thanks, should be fixed now.

Stefan, would you please eyeball the fix?