From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Jonas Bernoulli <jonas@bernoul.li>
Cc: 61176@debbugs.gnu.org
Subject: bug#61176: post-command-hook is not run if minibuffer input is aborted
Date: Sun, 05 Feb 2023 09:47:42 -0500 [thread overview]
Message-ID: <jwvmt5sji8q.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87sffojfs0.fsf@bernoul.li> (Jonas Bernoulli's message of "Thu, 02 Feb 2023 15:36:15 +0100")
> And if the user DOES abort, I would like the behavior to be changed like
> so:
>
>>> ;; -setup ([f1] -command)
>>> ;; -post ([] -command)
>>> ;; -exit ([7] abort-minibuffers)
>>> ;; Quit
>>> ;; -post ([] abort-minibuffers)
> *NEW* -post ([f1] -command)
Hmm... fully agreed and I wonder why it's not run.
[ The rest of the discussion is largely independent from this. ]
> The suffix command may use the minibuffer inside interactive and/or in
> its body. If that happens, then transient has to suspend the transient
> keymap and pre- and post-command functions, while the minibuffer is in
> use.
FWIW, I have played with similar issues in the context of prefix
commands and `set-transient-map` (yet, can't find the corresponding
code, sorry) and I remember using `minibuffer-depth` to detect the use
of a minibuffer (i.e. record the original `minibuffer-depth` and/or
`recursion-depth` compare it to the current depth in
`pre-command-hook`).
I see `transient.el` also uses `minibuffer-depth`, so I guess I'm not
telling you anything you didn't already know.
I also remember considering adding hooks to `read-from-minibuffer` and
`recursive-edit` so we can more proactively and reliably let-bind
variables around them (e.g. we should let-bind `this-command` around
them).
Stefan
prev parent reply other threads:[~2023-02-05 14:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 15:07 bug#61176: post-command-hook is not run if minibuffer input is aborted Jonas Bernoulli
2023-02-01 23:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-02 14:36 ` Jonas Bernoulli
2023-02-05 14:47 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
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=jwvmt5sji8q.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=61176@debbugs.gnu.org \
--cc=jonas@bernoul.li \
--cc=monnier@iro.umontreal.ca \
/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.