From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21747: 25.0.50; while-no-input breaks kbd event handling when called from post-command-hook Date: Sat, 24 Oct 2015 11:02:06 +0300 Message-ID: <838u6sy9s1.fsf@gnu.org> References: <87bnboemqb.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1445673803 4451 80.91.229.3 (24 Oct 2015 08:03:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Oct 2015 08:03:23 +0000 (UTC) Cc: 21747@debbugs.gnu.org To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 24 10:03:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZptnB-0000I2-KP for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Oct 2015 10:03:09 +0200 Original-Received: from localhost ([::1]:43376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZptnB-0006MO-6b for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Oct 2015 04:03:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zptn8-0006MJ-4X for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2015 04:03:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zptn4-00008c-NY for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2015 04:03:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zptn4-00008K-KA for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2015 04:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zptn4-0006LY-7G for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2015 04:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Oct 2015 08:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21747 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21747-submit@debbugs.gnu.org id=B21747.144567372524311 (code B ref 21747); Sat, 24 Oct 2015 08:03:02 +0000 Original-Received: (at 21747) by debbugs.gnu.org; 24 Oct 2015 08:02:05 +0000 Original-Received: from localhost ([127.0.0.1]:35468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zptm9-0006K3-39 for submit@debbugs.gnu.org; Sat, 24 Oct 2015 04:02:05 -0400 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:38733) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zptm6-0006Jf-O7 for 21747@debbugs.gnu.org; Sat, 24 Oct 2015 04:02:04 -0400 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NWP00F00SSU7W00@mtaout29.012.net.il> for 21747@debbugs.gnu.org; Sat, 24 Oct 2015 11:01:23 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NWP00ENRSYB3L10@mtaout29.012.net.il>; Sat, 24 Oct 2015 11:01:23 +0300 (IDT) In-reply-to: <87bnboemqb.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:107960 Archived-At: > From: Tassilo Horn > Date: Sat, 24 Oct 2015 09:42:36 +0200 > > With emacs -Q, evaluate the following in *stratch*: > > --8<---------------cut here---------------start------------->8--- > (defun th/loop-on-no-input () > (while-no-input (while t t))) > > (add-hook 'post-command-hook #'th/loop-on-no-input) > --8<---------------cut here---------------end--------------->8--- > > After having done that, the effect of pressing any key is deferred until > you press the next key. E.g., typing "foo" just inserts "fo", but after > an additional C-b (the exact key doesn't matter) you'll see "foo". I think what's deferred is redisplay, not the effect of pressing a key. IOW, the key does its thing, the character is inserted into the current buffer, but redisplay doesn't run, and so you don't see that inserted character, and think it was not inserted in the first place. Given that, maybe I'm missing something, but what did you expect? The above literally says that Emacs shall loop indefinitely after performing each command until there's more input. And that's what you get. Right? If I change the hook function to this: (defun th/loop-on-no-input () (while-no-input (while t (sit-for 0)))) then the "delay" goes away (although I still don't recommend such virulent post-command hooks, as they make an otherwise idle Emacs suck all the juice out of a single execution unit). Am I missing something here?