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: Wed, 22 Jun 2022 19:39:14 -0400 Message-ID: References: <46b65e3f-cf3d-a3f2-9a9a-100e58274ff6@jovi.net> <87k09rbcmn.fsf@gnus.org> <83a6an5jt3.fsf@gnu.org> <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> 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="16480"; 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 01:40:52 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 1o49xs-00045b-4r for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Jun 2022 01:40:52 +0200 Original-Received: from localhost ([::1]:36410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o49xq-0007m4-Jw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Jun 2022 19:40:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o49x5-0007kR-OR for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 19:40:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o49x4-0004Dq-W6 for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 19:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o49x4-0004HQ-Ni for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 19:40: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: Wed, 22 Jun 2022 23:40:02 +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.165594118416423 (code B ref 45898); Wed, 22 Jun 2022 23:40:02 +0000 Original-Received: (at 45898) by debbugs.gnu.org; 22 Jun 2022 23:39:44 +0000 Original-Received: from localhost ([127.0.0.1]:36848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o49wi-0004Gk-DL for submit@debbugs.gnu.org; Wed, 22 Jun 2022 19:39:44 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o49wU-0004GM-Ok for 45898@debbugs.gnu.org; Wed, 22 Jun 2022 19:39:38 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 31EE81001D2; Wed, 22 Jun 2022 19:39:21 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A2807100427; Wed, 22 Jun 2022 19:39:19 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1655941159; bh=Nhnhgio/rvD/KVFmSwBRMcHn2SSI6nmNw4QgsXV/B+0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dhtHXW3VznHNmh62QoV4v5M/KsaO9p+/Y1wNk0RoNJQhXn3i0r7RuTe7PDcsOUt6L 22muRGU1LMHoq/HF8x+4t1+Exj4IH2I88jpK44IeCjglwpv/2I3woyUNo3a3eykTYm cdRPS2hZPtB1OHYW0mvah3Yj5fC1fJ3i3GWLYQ+nk6KhnhSBQ0Z3aINH2Q9Mq4Hqi7 Szf54hiD2lVA9YAyysCMNp4PqeEGmL2wwiUFXYkVnSH0zriuBYYWKtutJc52Jin3V4 EYGf+APoI+Oz+XzZvP2+WPItli91S730KoRZtEBQQkYZEDVsUtRh7XWnmf8rw6o9Xq tvnhenDplb5CA== Original-Received: from alfajor (196.214.25.93.rev.sfr.net [93.25.214.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1B6FE1204DE; Wed, 22 Jun 2022 19:39:17 -0400 (EDT) In-Reply-To: <83mte5jukr.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 22 Jun 2022 05:33:24 +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:235056 Archived-At: > Isn't there a way to limit what font-lock considers a "line" such that > it doesn't consider more than some number N of characters? What could > potentially happen if we set N to, like, 10,000 characters? Misfontification around that boundary. > 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. > And even if the regexp-based font-lock needs to do it line-by-line, > does it really _have_ to invoke parse-partial-sexp for the entire > line, when doing syntactical fontifications? why is that? AFAICT this is a call that does (parse-partial-sexp (point) end nil nil state 'syntax-table) where `end` happens to be point-max (because of font-lock's rounding up to whole lines) which will not itself parse all the way to `end` but will instead stop at the next string/comment boundary. This is used (inside a loop which will indeed go all the way to `end`, i.e. `point-max`) to highlight strings and comments (as you can see from the stack trace, this is `font-lock-fontify-syntactically-region`). 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`. Stefan