all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Bhavin Gandhi <bhavin7392@gmail.com>
Cc: 56425@debbugs.gnu.org
Subject: bug#56425: 28.1; post-command-hook is triggered on y-or-n-p
Date: Wed, 06 Jul 2022 21:19:00 +0300	[thread overview]
Message-ID: <86wncqrtnv.fsf@mail.linkov.net> (raw)
In-Reply-To: <CAOn=hbeYWqqEC1GMQeAYtzR-BixGhehGF7k1GWUG_dGdyoH=ig@mail.gmail.com> (Bhavin Gandhi's message of "Wed, 6 Jul 2022 23:25:34 +0530")

> 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: "))





  reply	other threads:[~2022-07-06 18:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 17:55 bug#56425: 28.1; post-command-hook is triggered on y-or-n-p Bhavin Gandhi
2022-07-06 18:19 ` Juri Linkov [this message]
2022-07-06 19:03 ` Eli Zaretskii
2022-07-11 10:54   ` Lars Ingebrigtsen
2022-07-11 11:39     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86wncqrtnv.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=56425@debbugs.gnu.org \
    --cc=bhavin7392@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.