From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Unfreezing the display during auto-repeated scrolling. Simpler approach. Date: Thu, 30 Oct 2014 23:06:09 -0400 Message-ID: References: <83y4s1317s.fsf@gnu.org> <20141027193839.GD2771@acm.acm> <20141028181003.GA6630@acm.acm> <83wq7j0xqj.fsf@gnu.org> <20141029145211.GB2953@acm.acm> <20141029212525.GD2953@acm.acm> <20141030220919.GB2721@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414777803 25853 80.91.229.3 (31 Oct 2014 17:50:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2014 17:50:03 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 31 18:49:55 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 1XkGKd-0006Vo-9S for ged-emacs-devel@m.gmane.org; Fri, 31 Oct 2014 18:49:51 +0100 Original-Received: from localhost ([::1]:40195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkGKc-0005pm-UR for ged-emacs-devel@m.gmane.org; Fri, 31 Oct 2014 13:49:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkDxr-0005tc-Fa for emacs-devel@gnu.org; Fri, 31 Oct 2014 11:19:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xk2Xe-000136-5K for emacs-devel@gnu.org; Thu, 30 Oct 2014 23:06:29 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:47793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xk2XU-00012P-2n; Thu, 30 Oct 2014 23:06:12 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au4MAOatTlRFpY87/2dsb2JhbABcgw6DYoZ+y1MEAgKBHBcBAXyEAwEBAwFWIwULCw4mEhQYDSQsiB8Jy3IBAQEHAQEBAR6RCAeESwEEnxKQfYIRgW+EFCGCegEBAQ X-IPAS-Result: Au4MAOatTlRFpY87/2dsb2JhbABcgw6DYoZ+y1MEAgKBHBcBAXyEAwEBAwFWIwULCw4mEhQYDSQsiB8Jy3IBAQEHAQEBAR6RCAeESwEEnxKQfYIRgW+EFCGCegEBAQ X-IronPort-AV: E=Sophos;i="5.04,797,1406606400"; d="scan'208";a="95636764" Original-Received: from 69-165-143-59.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.165.143.59]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Oct 2014 23:06:10 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id E1B67AE312; Thu, 30 Oct 2014 23:06:09 -0400 (EDT) In-Reply-To: <20141030220919.GB2721@acm.acm> (Alan Mackenzie's message of "Thu, 30 Oct 2014 22:09:19 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:176106 Archived-At: > Who's going to decide when a "forced" display is to take place? That's the question, indeed. Maybe we could simply move the `input-pending' test so it's done before running the command. I.e. if there was no input pending when the command started, then don't skip the redisplay. For short-running commands, this will make no difference (since the probability that input arrives right during its execution is small), but and for long-running commands it may force redisplay even though there's input pending, but in that case the proportion of time spent in redisplay is smaller since the command's runtime is long. > So maybe a timer (?0.2s) could be inserted into the command loop, such > that if Emacs has been processing commands for that long since the last > redisplay, redisplay will be done in preference to processing the next > command. That's also an option, indeed. I don't like the sound of a preset duration between redisplays, tho. I'd rather measure the average redisplay time and then use a multiple of that. > That's not quite so clear when it's font-locking which is taking the > time, since it happens both in command processing and display. Yes, reality is more complex, of course. Hard to tell what will really work without an actual experiment. > Coming back to scrolling through xdisp.c, merely forcing a redisplay from > time to time isn't going to help the slowness of the scrolling. Either > eliminating most of the fontification or speeding it up radically (as Eli > would prefer) is necessary. Your experience has shown that jit-lock-defer-if-input-pending does let Emacs keep up (in the sense that Emacs comes back to life when you release the key), so I presume we'd use that, and combine it with an occasional forced redisplay. Stefan