From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61176: post-command-hook is not run if minibuffer input is aborted Date: Wed, 01 Feb 2023 18:06:24 -0500 Message-ID: References: <87y1pk2h8t.fsf@bernoul.li> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27257"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61176@debbugs.gnu.org To: Jonas Bernoulli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 02 00:07:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pNMCD-0006yM-09 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Feb 2023 00:07:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNMC1-000349-3g; Wed, 01 Feb 2023 18:07:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNMBz-00033u-9W for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2023 18:07:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNMBy-00068q-SO for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2023 18:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNMBy-0005l7-4z for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2023 18:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Feb 2023 23:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61176 X-GNU-PR-Package: emacs Original-Received: via spool by 61176-submit@debbugs.gnu.org id=B61176.167529280122107 (code B ref 61176); Wed, 01 Feb 2023 23:07:02 +0000 Original-Received: (at 61176) by debbugs.gnu.org; 1 Feb 2023 23:06:41 +0000 Original-Received: from localhost ([127.0.0.1]:60091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNMBd-0005kU-71 for submit@debbugs.gnu.org; Wed, 01 Feb 2023 18:06:41 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNMBZ-0005kA-83 for 61176@debbugs.gnu.org; Wed, 01 Feb 2023 18:06:39 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2247B1000D2; Wed, 1 Feb 2023 18:06:30 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0C64F1000CC; Wed, 1 Feb 2023 18:06:28 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1675292788; bh=FIxlNumDkqwPrOBCdQq46BtbqMdWELE2D6WSHRC/fCQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=E4POoj7AhIl5PHbwylkcKcw26tkShfDwB3q55DCM9z9tkHxKAlSNGyoT0f89zLmES h57FvIndWrPyH281zm5n32uuLsRouQb2nCdOEJwRJxj5+7x2PmnxEQzqRBSK5DUJ8+ cMYEa3uHIfxN0JBI6u4W1MQQRoKO8NXt5Wk3fdJ4Ar5teFeLVmLBbz4DHLZsVzw4aV M7UmVh6hGM3atfEKT5RqbrnfcWB5UAWilgOYXB1aTdo+xrcM5NbldUHwHyb/SDokGB f67uuETKIrbQt2BQznVokplnGqzc+mSJWCE4+4rA6iI4TyenIv/cZWloQPfEY4yI0S u+kAky9IrPcUg== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id F08A5120E61; Wed, 1 Feb 2023 18:06:27 -0500 (EST) In-Reply-To: <87y1pk2h8t.fsf@bernoul.li> (Jonas Bernoulli's message of "Mon, 30 Jan 2023 16:07:30 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254610 Archived-At: > - 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