Subject: bug#57179: 29.0.50: 'wrong-number-of-arguments' for function of two arguments called from 'window-scroll-functions'

From: Eli Zaretskii <[email-masked]>
Date: Sat, 13 Aug 2022 20:30:05 +0300

> From: Andrea Greselin <[email-masked]>
> Date: Sat, 13 Aug 2022 18:17:54 +0200
> 
> It's worked until I upgraded from v. 28.1 (from Fedora’s repos) to
> 29.0.50 (commit 6de88b6b02). Now I get
> 
>     Error in window-scroll-functions (my-recenter-after-jump):
> (wrong-number-of-arguments (lambda (window _window-start-after) "Recenter
> the point after a non-scroll command brings it out of view.
>     This function is meant to be called from the hook
>     ‘window-scroll-functions’." (let ((save-selected-window--state
> (internal--before-with-selected-window window))) (save-current-buffer
> (unwind-protect (progn (select-window (car save-selected-window--state)

The backtrace seems to show that a function that is called is
different from the one you show as your hook function.  So I think you
should look closer into how you set up window-scroll-functions.