all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
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: Wed, 01 Feb 2023 18:06:24 -0500	[thread overview]
Message-ID: <jwv7cx1807y.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87y1pk2h8t.fsf@bernoul.li> (Jonas Bernoulli's message of "Mon, 30 Jan 2023 16:07:30 +0100")

> - However, when the command reads from the minibuffer and the user
>   aborts that, then post-command-hook is NOT run a second time AFTER
>   the command.

Could you clarify what you mean here?
Let's say in the following scenario:

- The user hits a key like `M-x` which causes a minibuffer to be entered.
- the user hits C-g.
- Emacs exits the minibuffer and doesn't even call the command because
  the interactive args could not be gathered.

When do you expect `post-command-hook` to be run?

There's also the case where the command is called and it enters the
minibuffer (rather than doing it within the interactive spec).  Not sure
if it makes a significant difference.

Also it would help to know what you need `post-command-hook` for.

[ There are several "alternatives" to `post-command-hook` plus there
  are cases where code is executed not via a command, yet it can be
  viewed as a command execution as well (e.g. opening a file via
  `emacsclient`), so over the years ad-hoc calls to `post-command-hook`
  have been sprinkled outside of the "command-loop", which makes this
  whole business even more muddy.  ]


        Stefan






  reply	other threads:[~2023-02-01 23:06 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 [this message]
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

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=jwv7cx1807y.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.