On Mon, Oct 21, 2019 at 10:13 PM Stefan Kangas <stefan@marxist.se> wrote:

> (defun my-next-error ()
>   (interactive)
>   (next-error)
>   (recenter))
>
> What am I missing?

What's wrong with

  (add-hook 'next-error-hook 'recenter)

?