From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: bug-reference-prog-mode slows down CC Mode's scrolling by ~7% Date: Wed, 1 Sep 2021 18:20:25 +0000 Message-ID: References: <83r1e8p4w8.fsf@gnu.org> <83mtowp430.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30754"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 01 20:21:08 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLUrE-0007ml-PW for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Sep 2021 20:21:08 +0200 Original-Received: from localhost ([::1]:48702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLUrD-0004GL-B6 for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Sep 2021 14:21:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLUqd-0003bA-8B for emacs-devel@gnu.org; Wed, 01 Sep 2021 14:20:31 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:24772 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1mLUqb-0003R3-4r for emacs-devel@gnu.org; Wed, 01 Sep 2021 14:20:30 -0400 Original-Received: (qmail 27369 invoked by uid 3782); 1 Sep 2021 18:20:26 -0000 Original-Received: from acm.muc.de (p4fe15865.dip0.t-ipconnect.de [79.225.88.101]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 01 Sep 2021 20:20:25 +0200 Original-Received: (qmail 6953 invoked by uid 1000); 1 Sep 2021 18:20:25 -0000 Content-Disposition: inline In-Reply-To: <83mtowp430.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:273680 Archived-At: Hello, Eli. On Wed, Sep 01, 2021 at 21:01:55 +0300, Eli Zaretskii wrote: > > Date: Wed, 1 Sep 2021 17:55:46 +0000 > > Cc: emacs-devel@gnu.org > > From: Alan Mackenzie > > > (I thought that the code in jit-lock.el already handled this case by > > > computing a kind-of "maximum" out of all the return values of > > > jit-lock-functions, and treating a nil return value as expected, but > > > maybe my reading of the code was incorrect?) > > I think it rather uses the "minimum", i.e. the region common to all the > > return values from the jit-lock-functions. If one of these values is nil > > (as is the case here), that boils down to exactly the 500-byte chunk. > Then I think the easiest fix is to get bug-reference-prog-mode return > a suitable value, or wrap it in a function that would. Every function > that puts itself on jit-lock-functions without actually fontifying > anything should return BOB..EOB as the region it fontified, right? I'm not sure that's the right fix. If font-lock mode were disabled, say, bug-reference-fontify would be the only function on jit-lock-functions. Then it would fontify the first chunk at BOB, return (jit-lock-bounds . (BOB . EOB)), which would cause `fontified' to be set on the entire buffer, and no further chunks would get fontified at all. The mechanism with `jit-lock-bounds' in jit-lock.el is a good idea, but somehow it's not quite optimal at the moment. Maybe it could be improved. For example, if the first jit-lock-functions element returns (... (new-BEG . new-END)) we might be able to supply new-BEG, new-END as the arguments to the second element. Or something like that. -- Alan Mackenzie (Nuremberg, Germany).