From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Unfreezing the display during auto-repeated scrolling. Simpler approach. Date: Tue, 28 Oct 2014 18:10:03 +0000 Message-ID: <20141028181003.GA6630@acm.acm> References: <20141026124333.GA4397@acm.acm> <83h9yq4w5g.fsf@gnu.org> <20141026200313.GE4397@acm.acm> <20141026221530.GF4397@acm.acm> <20141027142801.GC2771@acm.acm> <83y4s1317s.fsf@gnu.org> <20141027193839.GD2771@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1414519887 6565 80.91.229.3 (28 Oct 2014 18:11:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Oct 2014 18:11:27 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 28 19:11:20 2014 Return-path: Envelope-to: ged-emacs-devel@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 1XjBEl-0004nF-4k for ged-emacs-devel@m.gmane.org; Tue, 28 Oct 2014 19:11:19 +0100 Original-Received: from localhost ([::1]:40738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjBEk-0003U6-13 for ged-emacs-devel@m.gmane.org; Tue, 28 Oct 2014 14:11:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjBEQ-0003Sd-M8 for emacs-devel@gnu.org; Tue, 28 Oct 2014 14:11:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjBEI-0006qp-PG for emacs-devel@gnu.org; Tue, 28 Oct 2014 14:10:58 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:56934 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjBEI-0006qU-Fm for emacs-devel@gnu.org; Tue, 28 Oct 2014 14:10:50 -0400 Original-Received: (qmail 88233 invoked by uid 3782); 28 Oct 2014 18:10:49 -0000 Original-Received: from acm.muc.de (pD9519FE5.dip0.t-ipconnect.de [217.81.159.229]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 28 Oct 2014 19:10:48 +0100 Original-Received: (qmail 6732 invoked by uid 1000); 28 Oct 2014 18:10:04 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:175936 Archived-At: Hello, Stefan. On Mon, Oct 27, 2014 at 05:38:06PM -0400, Stefan Monnier wrote: > >> If jit-lock-defer-time produces the desired effect, > It doesn't, currently. But the technique can be tweaked. > > PageDown key. However, on single PageDowns, the fact that the text is > > first displayed and only later (~0.1s) fontified could be disturbing to > > some people. > I suggested earlier to change jit-lock-defer so that deferral only takes > place if there's pending input. It might take care of this case. It doesn't. :-( I've set my jit-lock-defer-time to 0.03s. Then I tried adding this condition to jit-lock-function, so that it looks like: (when (and jit-lock-mode (not memory-full)) (if (or (null jit-lock-defer-timer) (not (input-pending-p))) <================ )) What then happens is that some fontification requests from the scrolling code (NOT from display) become "non-deferred", and jit-lock fontifies these chunks. By the time it's done this, there are more PageDown events in the input queue, so Emacs doesn't get to redisplay anything. The screen is frozen, but becomes free as soon as the key is released (within a second). This is inadequate. I've tried making the C variable redisplaying_p visible in lisp (through the new function `redisplaying-p') and testing that in the above condition too, so that we only do undeferred fontification when the request comes from redisplay. Aside from the objectionableness of never fontifying for any reason other than redisplay, this doesn't seem to help matters: auto-repeating PageDown rapidly scrolls all(?) buffer regions unfontified, but there is the ~0.1s gap between displaying the last screen and it being fontified. This is also not good. I don't think jit-lock's defer can be brought to do what we want. > Stefan -- Alan Mackenzie (Nuremberg, Germany).