From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#50042: acknowledged by developer (control message for bug #50042) Date: Fri, 20 Aug 2021 15:09:53 +0200 Message-ID: <87mtpc8dpa.fsf@gnus.org> References: <878s13os3a.fsf@gnus.org> <87lf4x8twc.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10539"; 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 To: Simon Katz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 20 15:11:13 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 1mH4Ij-0002SC-7R for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Aug 2021 15:11:13 +0200 Original-Received: from localhost ([::1]:45294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mH4Ih-0003YR-75 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Aug 2021 09:11:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH4IZ-0003YI-20 for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2021 09:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mH4IY-0002eI-R9 for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2021 09:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mH4IY-0003Ae-EU for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2021 09:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Aug 2021 13:11:02 +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.162946500912114 (code B ref 50042); Fri, 20 Aug 2021 13:11:02 +0000 Original-Received: (at 50042) by debbugs.gnu.org; 20 Aug 2021 13:10:09 +0000 Original-Received: from localhost ([127.0.0.1]:33243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mH4Hg-00039J-Hf for submit@debbugs.gnu.org; Fri, 20 Aug 2021 09:10:08 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:59970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mH4He-00038f-L8 for 50042@debbugs.gnu.org; Fri, 20 Aug 2021 09:10:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JKSfeyzgqOGQBcYZJGACkFyWzLGFNXvoN+2za6u/drw=; b=Ttnw/ykwKZyXbucg3tdKT+WvVO ry8iF+JprrCIgQ/4Xx0etFMronskQajBLHJuG8wlAZ7sLNf5Tw/a+22B8GdPukvP/M0q1L0b8RFC6 bxr2fKgtZUcKq0PBQKeT+nQnK5aQ0V5g18PBHmL6S96kb/lP//aS5EhIwleiI0VaeGsY=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mH4HT-0004G4-Bc; Fri, 20 Aug 2021 15:09:59 +0200 In-Reply-To: (Simon Katz's message of "Thu, 19 Aug 2021 15:55:58 +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" Xref: news.gmane.io gmane.emacs.bugs:212265 Archived-At: --=-=-= Content-Type: text/plain Simon Katz writes: >> The file for reproducing the problem was apparently mangled during >> transmission, too. Can you re-send the file as an attachment? > > Sure. Please find it attached. Thanks. When I hoisted the final waiting from the command, I totally didn't notice that there was even more waiting there (in the case of a command that had displayed a message). I've now tweaked this further, and it now seems to work correctly in all the message/no keybinding/keybinding cases, I think... Can you test this, too, to see if I got all the cases right? That is, it shouldn't display anything if you do anything else before the suggestion triggers, and it shouldn't inhibit entering other commands, and... er... no other peculiarities. One thing that is peculiar, but no more than before, is this bit: ;; FIXME: Can be slow. Cache it maybe? (setq binding (execute-extended-command--shorter (symbol-name function) typed)))) It takes five seconds on my laptop, which means that these suggestion arrive five seconds after I did the `M-x'. But that hasn't changed since before these patches. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=demo-post-command-hook-slow-with-m-x-commands-v2.el Content-Transfer-Encoding: quoted-printable (run-at-time 1 nil (lambda () (switch-to-buffer "*Messages*" nil t) (display-buffer (generate-new-buffer "my-output")) ;; Arrange things so that we see the output as it appears: (select-window (get-buffer-window "my-output")))) (defun date-time () (format-time-string "%Y-%m-%d %H:%M:%S")) (defun post-command-message () (when (member this-command '(**-msg-cmd-with-key-binding **-msg-cmd-without-key-binding **-msg-cmd-with-no-message)) (with-current-buffer "my-output" (goto-char (point-max)) (insert (date-time) " The command `" (format "%s" this-command) "` was executed\n") (goto-char (point-max))))) (add-hook 'post-command-hook 'post-command-message) (defun **-msg-cmd-without-key-binding () (interactive) (message "%s Hello from `**-msg-cmd-without-key-binding`" (date-time))) (defun **-msg-cmd-with-key-binding () (interactive) (message "%s Hello from `**-msg-cmd-with-key-binding`" (date-time))) (define-key global-map (kbd "C-c C-c") '**-msg-cmd-with-key-binding) (defun **-msg-cmd-with-no-message () (interactive)) (define-key global-map (kbd "C-c C-c") '**-msg-cmd-with-key-binding) (define-key global-map (kbd "C-c C-d") '**-msg-cmd-with-no-message) --=-=-=--