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#50042: 26.3; Post-command hooks slow with M-x commands Date: Sat, 14 Aug 2021 16:52:27 -0400 Message-ID: References: <87lf55edhd.fsf@gnus.org> <87tujsq8ze.fsf@gnus.org> 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="8955"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 50042@debbugs.gnu.org, Simon Katz To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 14 22:53:10 2021 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 1mF0eU-00026M-IU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Aug 2021 22:53:10 +0200 Original-Received: from localhost ([::1]:50794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mF0eS-0002Nr-P9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Aug 2021 16:53:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mF0eM-0002Nj-3R for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2021 16:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33925) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mF0eL-0002eX-TV for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2021 16:53:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mF0eL-0007XW-MC for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2021 16:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Aug 2021 20:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50042 X-GNU-PR-Package: emacs Original-Received: via spool by 50042-submit@debbugs.gnu.org id=B50042.162897436528956 (code B ref 50042); Sat, 14 Aug 2021 20:53:01 +0000 Original-Received: (at 50042) by debbugs.gnu.org; 14 Aug 2021 20:52:45 +0000 Original-Received: from localhost ([127.0.0.1]:45471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mF0e1-0007Wu-PF for submit@debbugs.gnu.org; Sat, 14 Aug 2021 16:52:45 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2357) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mF0dw-0007WZ-IS for 50042@debbugs.gnu.org; Sat, 14 Aug 2021 16:52:40 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 921B9440BEC; Sat, 14 Aug 2021 16:52:30 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D97ED440BE5; Sat, 14 Aug 2021 16:52:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1628974348; bh=3OD6wXuFmPZsXenajJhcktnTdD9IYrtB33a2FZ7t4LE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Ctfml4AaHa1WDeY/NyW1HqnvzmxrY/jIP3m+JA05xLRJkdCKrR2ZpCwkvqpl8Adgr j0K1gzQV0RLA576TxJTVD/ZmkyqzEsD5CLkpugr4+Taf6knwbMovm2OXtMzxDrkAxr h5TQX1J5hdY9IrshUezRkQGI5zbh/n6+6JecG80Is8DqfoF3CTlS8YLGdQ0QuaQKkm wrptsI85sCiQDMCvMFo7mbbj1ZW3JSiJsZX2LHeL/z2bimODd1krrkYiBO3oZjg9tv 9RpZ0V7ncxs5JqisiZmh8wODqI6JCpvf+SNhxvyfUojsODZVw4DQi7utCQ3m2P4h22 y+EOhr91I5lPw== Original-Received: from alfajor (unknown [104.247.244.135]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 973F612041B; Sat, 14 Aug 2021 16:52:28 -0400 (EDT) In-Reply-To: <87tujsq8ze.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 14 Aug 2021 18:36:21 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:211856 Archived-At: >> `execute-extended-command' ends with >> >> (when binding >> (with-temp-message >> (format-message "You can run the command `%s' with %s" >> function >> (if (stringp binding) >> (concat "M-x " binding " RET") >> (key-description binding))) >> (sit-for (if (numberp suggest-key-bindings) >> suggest-key-bindings >> 2)))))))) Indeed this `sit-for` is a problem because it delays running the `post-command-hook`. [ We have a few other such problems, tho I sadly didn't bother to keep track of them. ] > Stefan, I forgot to put you on the CCs here -- I wondered whether you > had any ideas here. I think lifting this out of > `execute-extended-command' should be possible -- either by doing > something a la > > (run-at-time 0 nil (lambda () > (with-temp-message "The binding is foo" > (sit-for 1)))) > > or making `execute-extended-command' set a variable and do the messaging > from the "command loop" after running post-command-hook. Using a timer might be a good option, indeed. Stefan