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

From: Juri Linkov <[email-masked]>
Date: Wed, 06 Jul 2022 21:19:00 +0300

> Is read-from-minibuffer triggering the post-command-hook?

This is the most interesting question.  When you replace the y-or-n-p call
in your code with read-from-minibuffer, do you see the same result?

If not, then maybe these lines y-or-n-p affect the behavior somehow,
but I'm sure:

  ;; Protect this-command when called from pre-command-hook (bug#45029)
  (this-command this-command)

If all fails, then as the last resort you always have an option to
fall back to the modal behavior of y-or-n-p by wrapping the call
with y-or-n-p-use-read-key:

  (let ((y-or-n-p-use-read-key t)) (y-or-n-p "Some question: "))