From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba 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:30:42 +0100 Message-ID: References: <87bnboemqb.fsf@gnu.org> <838u6sy9s1.fsf@gnu.org> <877fmcejgn.fsf@gnu.org> <83ziz8wrun.fsf@gnu.org> <8737x0egvm.fsf@gnu.org> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c37e066789af0522d73858 X-Trace: ger.gmane.org 1445682742 30241 80.91.229.3 (24 Oct 2015 10:32:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Oct 2015 10:32:22 +0000 (UTC) Cc: Stefan Monnier , 21747@debbugs.gnu.org, Kim Storm To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 24 12:32:12 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 1Zpw7Q-0000aJ-0B for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Oct 2015 12:32:12 +0200 Original-Received: from localhost ([::1]:43710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpw7P-0007NI-C3 for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Oct 2015 06:32:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpw7L-0007NA-A0 for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2015 06:32:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zpw7G-00026r-El for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2015 06:32:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpw7G-00026h-Bq for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2015 06:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zpw7G-0001YS-2n for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2015 06:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Oct 2015 10:32: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.14456826655909 (code B ref 21747); Sat, 24 Oct 2015 10:32:02 +0000 Original-Received: (at 21747) by debbugs.gnu.org; 24 Oct 2015 10:31:05 +0000 Original-Received: from localhost ([127.0.0.1]:35590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zpw6K-0001XE-Q4 for submit@debbugs.gnu.org; Sat, 24 Oct 2015 06:31:05 -0400 Original-Received: from mail-lf0-f48.google.com ([209.85.215.48]:33697) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zpw60-0001WO-2m for 21747@debbugs.gnu.org; Sat, 24 Oct 2015 06:31:02 -0400 Original-Received: by lffv3 with SMTP id v3so106308605lff.0 for <21747@debbugs.gnu.org>; Sat, 24 Oct 2015 03:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=XhJkkURB674FVjmlRR2nnNk9Z7NSX7A42hessvEraxQ=; b=uJ73sgF8rlUVwVl5nieL4vBkYJfvtdzhIL5r0KfcxbHKYCQOi49gr0vKIVZMEZAAC6 0wSaqqKCzajOXTe+GgNBEEPzFKPq+Z67DirLK9zMkjUxvoqgcaD/bDpL8Tno/0zdxdtH u/FM3/eyXLgZd43eUIa51For44hxIplvQhJHlUjJcOozb8kG1bU+yOg8zYyyTFuDdhv5 ID3W3xGV6ZBVZnvCYxgficUW5PQapqmhHVeqImoz3JDNKijmwHjT4DzroDmTnlsENZAz jg5UvUSrVz+ciut8t8tG7KSOskpUTTMrna0fI8cmoimJdkjXs+mJYIMGEfPNCIgSJO0+ 30uQ== X-Received: by 10.112.169.98 with SMTP id ad2mr12617243lbc.2.1445682643174; Sat, 24 Oct 2015 03:30:43 -0700 (PDT) Original-Received: by 10.112.91.106 with HTTP; Sat, 24 Oct 2015 03:30:42 -0700 (PDT) Original-Received: by 10.112.91.106 with HTTP; Sat, 24 Oct 2015 03:30:42 -0700 (PDT) In-Reply-To: <8737x0egvm.fsf@gnu.org> X-Google-Sender-Auth: mK4IYF6nOsK7_VSiQ_dyZkcffDY 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:107977 Archived-At: --001a11c37e066789af0522d73858 Content-Type: text/plain; charset=UTF-8 On 24 Oct 2015 10:49 am, "Tassilo Horn" wrote:> >> So the question is: should `while-no-input' call (sit-for 0) as the > >> first statement in the `progn' or should functions using > >> `while-no-input' do that on their own? I'd prefer the former because > >> the current behavior is not really obvious (at least not to me nor > >> Artur). > > > > I don't have enough experience in using while-no-input to answer that. > > Perhaps others could chime in and voice their opinions. Maybe we > > should have a discussion on emacs-devel about this (because many > > people who read emacs-devel don't read the bug list). > > Yes, I think that would be a good idea. Originally, `while-no-input' > used (not (sit-for 0 0 t)) instead of (input-pending-p) which I think is > pretty equivalent except that the former forces a redisplay. Reading this discussion, it sounds to me like this is more about post-command-hook than while-no-input. By the time this code is run, the user's input has been received and processed. The reason why redisplay doesn't happen is the fact that this code is running on post-command-hook. So maybe the docstring for post-command-hook should point out this detail and recommend that functions added to this hook call sit-for if they're going to do potentially expensive processing. --001a11c37e066789af0522d73858 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On 24 Oct 2015 10:49 am, "Tassilo Horn" <tsdh@gnu.org> wrote:> >> So the question is: sho= uld `while-no-input' call (sit-for 0) as the
> >> first statement in the `progn' or should functions using<= br> > >> `while-no-input' do that on their own?=C2=A0 I'd pref= er the former because
> >> the current behavior is not really obvious (at least not to m= e nor
> >> Artur).
> >
> > I don't have enough experience in using while-no-input to ans= wer that.
> > Perhaps others could chime in and voice their opinions.=C2=A0 May= be we
> > should have a discussion on emacs-devel about this (because many<= br> > > people who read emacs-devel don't read the bug list).
>
> Yes, I think that would be a good idea.=C2=A0 Originally, `while-no-in= put'
> used (not (sit-for 0 0 t)) instead of (input-pending-p) which I think = is
> pretty equivalent except that the former forces a redisplay.=C2=A0

Reading this discussion, it sounds to me like this is more a= bout post-command-hook than while-no-input.
By the time this code is run, the user's input has been received and pr= ocessed. The reason why redisplay doesn't happen is the fact that this = code is running on post-command-hook.

So maybe the docstring for post-command-hook should point ou= t this detail and recommend that functions added to this hook call sit-for = if they're going to do potentially expensive processing.

--001a11c37e066789af0522d73858--