From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#45898: 27.1; wedged in redisplay again Date: Fri, 24 Jun 2022 10:57:30 +0300 Message-ID: <83o7yicx3p.fsf@gnu.org> References: <46b65e3f-cf3d-a3f2-9a9a-100e58274ff6@jovi.net> <8335gf5er3.fsf@gnu.org> <87leu686z4.fsf@gnus.org> <83sfoe2k0j.fsf@gnu.org> <87zgim6qtt.fsf@gnus.org> <83mtem2dc9.fsf@gnu.org> <87y1y63qmq.fsf@gnus.org> <83h74t3k5u.fsf@gnu.org> <87tu8sx569.fsf@gnus.org> <83v8t6us8t.fsf@gnu.org> <87zgiinptk.fsf@gnus.org> <83mteiufih.fsf@gnu.org> <877d5kojbo.fsf@gnus.org> <83zgigu3e0.fsf@gnu.org> <500e4b9c69f2a90e7cf05b956178d71b@webmail.orcon.net.nz> <835yl3tnv3.fsf@gnu.org> <83iloyo0x7.fsf@gnu.org> <83mte5jukr.fsf@gnu.org> <837d57gbed.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10019"; mail-complaints-to="usenet@ciao.gmane.io" Cc: psainty@orcon.net.nz, larsi@gnus.org, Emacs-hacker2018@jovi.net, 45898@debbugs.gnu.org To: Stefan Monnier , Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 24 09:58:22 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1o4eCs-0002Nw-MW for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jun 2022 09:58:22 +0200 Original-Received: from localhost ([::1]:40812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4eCr-000437-PN for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jun 2022 03:58:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4eCY-0003v5-6y for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2022 03:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4eCX-0000R2-S4 for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2022 03:58:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o4eCX-0000XX-Qa for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2022 03:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Jun 2022 07:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45898 X-GNU-PR-Package: emacs Original-Received: via spool by 45898-submit@debbugs.gnu.org id=B45898.16560574702056 (code B ref 45898); Fri, 24 Jun 2022 07:58:01 +0000 Original-Received: (at 45898) by debbugs.gnu.org; 24 Jun 2022 07:57:50 +0000 Original-Received: from localhost ([127.0.0.1]:40772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4eCH-0000X0-TU for submit@debbugs.gnu.org; Fri, 24 Jun 2022 03:57:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4eCG-0000Wn-30 for 45898@debbugs.gnu.org; Fri, 24 Jun 2022 03:57:45 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4eC9-0000MM-Fk; Fri, 24 Jun 2022 03:57:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Uney4jInQD4p4RcF97rygenzV0sANH2uEjQOE/3ck3c=; b=NP44hifEvcPeIWG8e3FL 7Cl3VSkQHdxF+kgNQp+EA9scmw6WqiB7sdWZEysnYOdozmo/FeGP6+1zWPnc4r4KeHDM7iKxlIYMF glg4LfXNSF2kfNVMY3Lef6u1Yg5L4vtFanMicbVnhyMxvBRXyfggSnbhHf4sUV0xMHNj33ZlmOlfh M7ib8OrjMsrYEHRk6yztLLaMUz0TD5H1ck28Ce+3g87RtGauiquUUY3wDXW8xzZ2VnzdaRO8yXd7W kj/loTmYXYnXlIxXS3WkCc1XbldK7cHljG57bQ1jCOnxpnEFCq7LvctyWZQos4nkwnMgR3djzrtas 2DFhP+phlwoNHg==; Original-Received: from [87.69.77.57] (port=2524 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4eC8-0004EH-VM; Fri, 24 Jun 2022 03:57:37 -0400 In-Reply-To: (message from Stefan Monnier on Thu, 23 Jun 2022 17:14:50 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235156 Archived-At: > From: Stefan Monnier > Cc: larsi@gnus.org, psainty@orcon.net.nz, Emacs-hacker2018@jovi.net, > 45898@debbugs.gnu.org > Date: Thu, 23 Jun 2022 17:14:50 -0400 > > >> For such huge files, it's arguably more important to be more-or-less > >> usable than it is to get the highlighting right, so there's a good case > >> for turning off font-lock or breaking it somewhat by using arbitrary > >> limits in the handling of `font-lock-extend-region-functions` in > >> `font-lock-default-fontify-region`. > > I'm talking about cases where the user visits such files without > > knowing in advance that he/she has better turned off font-lock there. > > I'm asking whether one of the things we could do when we discover that > > parse-partial-sexp is called for such a large chunk of text could be > > automatic introduction of such a limit only for that buffer, so that > > font-lock won't be such a significant part of the reason for redisplay > > slowness in these cases. > > Yes, that's exactly what I'm proposing in the paragraph you quoted. > I think it makes sense to bound the growth of the region due to > `font-lock-extend-region-functions`. We could bound it where we handle > `font-lock-extend-region-functions`, or we could bound it just inside > `font-lock-extend-region-wholelines`. I hope this will be done soon. I've landed the feature on master, let me know (everyone, not just Stefan) how it fares. Gerd, your comments will be most appreciated, TIA. > > I guess this is related to font-lock > > settings of js.el, but my question is: would any mode that uses > > syntactic fontification be similarly affected, or is there anything > > special with js.el specifically? > > I think pretty much any major mode would be affected. It can be more or > less severe depending on how much work is done inside > `font-lock-keywords` (and `syntax-propertize`), but by and large I'd > expect it to suck for all non-trivial modes. For now, you will see that the code I installed "punishes" syntax.c for exploring too many character positions, hope this is "good enough" for the relevant pathological situations.