Subject: bug#37856: 27.0.50; 'next-error' advised with 'recenter' signals error when run from "*grep*" buffer

From: Eli Zaretskii <[email-masked]>
Date: Tue, 22 Oct 2019 05:28:07 +0300

> From: Stefan Kangas <[email-masked]>
> Date: Mon, 21 Oct 2019 22:11:50 +0200
> Cc: [email-masked]
> 
> It was surprising to me that this didn't work, and it's not clear what
> I should do instead.  For example, the following code exhibits the
> same problem:
> 
> (defun my-next-error ()
>   (interactive)
>   (next-error)
>   (recenter))
> 
> What am I missing?

The advice effectively "injects" your code into the advised function,
just before it returns.