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: Mon, 27 Oct 2014 19:38:39 +0000 Message-ID: <20141027193839.GD2771@acm.acm> References: <83oat59ucc.fsf@gnu.org> <20141021183807.GD3035@acm.acm> <20141026124333.GA4397@acm.acm> <83h9yq4w5g.fsf@gnu.org> <20141026200313.GE4397@acm.acm> <20141026221530.GF4397@acm.acm> <20141027142801.GC2771@acm.acm> <83y4s1317s.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1414438792 2560 80.91.229.3 (27 Oct 2014 19:39:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Oct 2014 19:39:52 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 27 20:39:44 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 1Xiq8l-0007es-Ja for ged-emacs-devel@m.gmane.org; Mon, 27 Oct 2014 20:39:43 +0100 Original-Received: from localhost ([::1]:35645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xiq8l-0006Dy-5P for ged-emacs-devel@m.gmane.org; Mon, 27 Oct 2014 15:39:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xiq8e-0006Dk-2O for emacs-devel@gnu.org; Mon, 27 Oct 2014 15:39:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xiq8R-0005aC-UF for emacs-devel@gnu.org; Mon, 27 Oct 2014 15:39:36 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:50554 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xiq8R-0005ZS-GV for emacs-devel@gnu.org; Mon, 27 Oct 2014 15:39:23 -0400 Original-Received: (qmail 57275 invoked by uid 3782); 27 Oct 2014 19:39:19 -0000 Original-Received: from acm.muc.de (pD951B8EC.dip0.t-ipconnect.de [217.81.184.236]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 27 Oct 2014 20:39:17 +0100 Original-Received: (qmail 25324 invoked by uid 1000); 27 Oct 2014 19:38:39 -0000 Content-Disposition: inline In-Reply-To: <83y4s1317s.fsf@gnu.org> 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:175906 Archived-At: Hello, Eli. On Mon, Oct 27, 2014 at 06:51:35PM +0200, Eli Zaretskii wrote: > > Date: Mon, 27 Oct 2014 14:28:01 +0000 > > Cc: Eli Zaretskii , emacs-devel@gnu.org > > From: Alan Mackenzie > > > Please take a look at what jit-lock-defer does. > > It sets a non-nil fontified text-property without doing any > > fontification (yet). I think you're suggesting "binding" > > jit-lock-defer over the scroll operation, thus inhibiting fontification. > > I've had a simpler idea: bind fontification-functions to nil over the > > scroll operation. This avoids many of the pitfalls of my last patch, and > > can be perfectly specific to scrolling by whole screens and nothing else, > > and is much simpler and less intrusive. It works well. > > Here's a patch, which does precisely that. Comments welcome, as always: > If jit-lock-defer-time produces the desired effect, I see no need to > have yet another separate knob to achieve the same effect just during > scrolling. I've just tried out jit-lock-defer-time with 0.03s and 0.001s. (Just as a matter of interest, j-l-d-time changes only take effect on restarting font-lock mode, so it's best to make changes with f-l mode disabled.) At 0.03s, the effect on holding down PageDown was for seemingly all screens to be displayed at they scrolled by, but unfontified. There was no waiting for Emacs to be ready for more keypresses after releasing the 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. At 0.001s, the screens scrolled by more stutteringly, some of them managing to get fontified, with hints of colour visible from time to time. Otherwise, much like 0.03s. Overall, using jit-lock-defer-time feels more like a workaround than a solution, but perhaps I'm not the best person to judge. If it were possible, on auto-repeat, to have all screens displayed unfontified, yet not have the 0.1s delay between delay and fontification on single keypresses, that would be the best of all worlds. In any case, some extra documentation on page "Scrolling" in the Emacs manual is probably warranted. -- Alan Mackenzie (Nuremberg, Germany).