Subject: Re: bug#56425: 28.1; post-command-hook is triggered on y-or-n-p

From: Eli Zaretskii <[email-masked]>
Date: Wed, 06 Jul 2022 22:03:45 +0300

> From: Bhavin Gandhi <[email-masked]>
> Date: Wed, 6 Jul 2022 23:25:34 +0530
> 
> Also, my-test-command has not finished executing yet, it is waiting for
> user input, so how does it trigger the post-command-hook?  I'm not able
> to understand what causes it to trigger the post-command-hook, is it an
> expected behavior?

Yes.

> I'm I missing something here? Is read-from-minibuffer
> triggering the post-command-hook?

Yes.

Why are you surprised?  y-or-n-p invokes read-from-minibuffer, which
invokes recursive-edit, which starts a recursive command loop.  And
the command loop calls post-command-hook on each iteration.