From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25265: [PATCH] Rework NS event handling (bug#25265) Date: Sun, 01 Jan 2017 17:42:58 +0200 Message-ID: <834m1ihjlp.fsf@gnu.org> References: <83vau0h2u5.fsf@gnu.org> <20161231160930.GA29122@breton.holly.idiocy.org> <20170101150352.GA61550@breton.holly.idiocy.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1483285464 14449 195.159.176.226 (1 Jan 2017 15:44:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 1 Jan 2017 15:44:24 +0000 (UTC) Cc: charles@aurox.ch, 25265@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 01 16:44:18 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNiIq-0001Ug-SA for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Jan 2017 16:44:09 +0100 Original-Received: from localhost ([::1]:53719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNiIt-00019E-8G for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Jan 2017 10:44:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNiIn-000197-K8 for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 10:44:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cNiIk-00043Y-HK for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 10:44:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cNiIk-00043F-Ee for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 10:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cNiIk-0006fG-6e for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 10:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Jan 2017 15:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25265 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25265-submit@debbugs.gnu.org id=B25265.148328538325540 (code B ref 25265); Sun, 01 Jan 2017 15:44:02 +0000 Original-Received: (at 25265) by debbugs.gnu.org; 1 Jan 2017 15:43:03 +0000 Original-Received: from localhost ([127.0.0.1]:38710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNiHn-0006ds-AY for submit@debbugs.gnu.org; Sun, 01 Jan 2017 10:43:03 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNiHl-0006dO-Tk for 25265@debbugs.gnu.org; Sun, 01 Jan 2017 10:43:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cNiHd-0003SP-H9 for 25265@debbugs.gnu.org; Sun, 01 Jan 2017 10:42:56 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNiHd-0003SL-Dt; Sun, 01 Jan 2017 10:42:53 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2685 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cNiHc-0002lv-Ju; Sun, 01 Jan 2017 10:42:53 -0500 In-reply-to: <20170101150352.GA61550@breton.holly.idiocy.org> (message from Alan Third on Sun, 1 Jan 2017 15:03:52 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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" Xref: news.gmane.org gmane.emacs.bugs:127659 Archived-At: > Date: Sun, 1 Jan 2017 15:03:52 +0000 > From: Alan Third > Cc: charles@aurox.ch, 25265@debbugs.gnu.org > > OK, I’m running into performance bugs with this almost straight away. > > It all looks OK until I start flyspell-mode. Then it appears that > redisplay is only called every two or three keypresses. It looks like > Emacs is still going fine, though, as messages to the modeline appear, > even if the action isn’t immediately displayed in the buffer. > > For example, I open up an org file and start flyspell-mode, then I hit > the down arrow which should take me to a heading but the cursor > doesn’t move. Then I hit TAB, and I get a message in the modeline > telling me that the section associated with the heading has been > expanded, but the buffer is still displayed with the cursor on the > previous line and the section not expanded. Finally I hit the down > arrow again and the buffer updates to display the expanded section and > the cursor where I’d expect it. > > emacsclient runs with a delay, which I guess corresponds to the > timeout on the NS event queue check. > > I’m not at all sure how to fix these problems. Do you understand the problems, though? The crucial question is why isn't redisplay being called as it was called before the changes? One way of answering that would be to run the previous version under a debugger, put a breakpoint in redisplay_internal, show a backtrace to see who called it, and continue. Then do the same in the new version, and see if you can spot any differences. Do you really need to type several keys to get redisplay? Or is it enough to type just one and wait for some time? IOW, if you type one key, then wait, does redisplay ever happen? Thanks.