Subject: bug#12077: Abort in replace-regexp with an after-change-functions hook

From: Glenn Morris <[email-masked]>
Date: Tue, 19 Feb 2013 13:04:50 -0500

Glenn Morris wrote:

>>>     (with-temp-buffer
>>>       (insert "#\n*\n")
>>>       (goto-char (point-min))
>>>       (add-hook 'after-change-functions
>>>                 (lambda (a b c) (re-search-forward "\n" nil t)))
>>>       (replace-regexp "^\\*" " *"))
>
> By experiment, this issue is present in at least 22.3 through 24.2.93,
> but is fixed in the current trunk.

PS if someone feels like checking exactly what fixed this, then if it is
a simple and obviously safe change, it could go in emacs-24. But since
this is a long-standing issue, this is not essential.