From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#45898: 27.1; wedged in redisplay again Date: Thu, 23 Jun 2022 17:14:50 -0400 Message-ID: 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> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8530"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: psainty@orcon.net.nz, larsi@gnus.org, Emacs-hacker2018@jovi.net, 45898@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 23 23:16:29 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 1o4UBg-00024K-Cu for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Jun 2022 23:16:28 +0200 Original-Received: from localhost ([::1]:47488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4UBf-0004r8-D6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Jun 2022 17:16:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4UBW-0004pE-Rz for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2022 17:16:20 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4UBG-0003qQ-7F for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2022 17:16:18 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o4UBG-0007M3-0W for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2022 17:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Jun 2022 21:16: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.165601890428198 (code B ref 45898); Thu, 23 Jun 2022 21:16:01 +0000 Original-Received: (at 45898) by debbugs.gnu.org; 23 Jun 2022 21:15:04 +0000 Original-Received: from localhost ([127.0.0.1]:40121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4UAJ-0007Kj-SH for submit@debbugs.gnu.org; Thu, 23 Jun 2022 17:15:04 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:11670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4UAH-0007Jn-Bf for 45898@debbugs.gnu.org; Thu, 23 Jun 2022 17:15:03 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C02BA8076B; Thu, 23 Jun 2022 17:14:55 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D080B80636; Thu, 23 Jun 2022 17:14:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1656018893; bh=NcW1Cqd05y3At0xiggvdzBLdflBXRI0WKcz4CfG+k6E=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=FYyV2Cha7yEXP8Pfrebl6Mfhbs9ScrKNE00+mtB+XDyAO4y27rXK7ckJUndU0vxJ8 fv+nnmLdmZdV/H/9+BEu8LNoF/6QbQrRHSW3jCoaDRI2PwOSwudgFL3nZAXmfSfxrP wnHA5XJjTbC/3foG/FOBwmQ17PCxB6S45af66z7OQDE+0AZVhcDLGyro9GRkIIHrS8 V6cDDxjzJ7sLx2rwQYwPwuZoldk7LLJ30Y98XdAOMWryM61rdSNtgqwhZFNKPjUdWt sqm6/DoKNuCgRwOU/dQYEF+eYOYEAfGLoRHLksW3yKyqS1FIVXo+/W1BL89EEHLIr8 bAMC/0YqI9VUA== Original-Received: from alfajor (196.214.25.93.rev.sfr.net [93.25.214.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D67C2120346; Thu, 23 Jun 2022 17:14:52 -0400 (EDT) In-Reply-To: <837d57gbed.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 23 Jun 2022 09:08:10 +0300") 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:235137 Archived-At: >> > Are you saying that many regular expressions in font-lock-keywords are >> > anchored at beginning or end of a line? >> No but for example if the 10000 char boundary falls in the middle of the >> word "function", then all the highlighting rules which rely on matching >> the keyword "function" will fail. > So we value accurate fontification more than we value a usable Emacs > session? There was no value judgment in my answer :-) >> 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`. > Also, can you tell why visiting the same file in Text mode doesn't > produce the same effect? Probably because it doesn't setup font-lock mode? > 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. Stefan