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#56682: Fix the long lines font locking related slowdowns Date: Sun, 14 Aug 2022 22:41:50 -0400 Message-ID: References: <2c8d6755-cfe2-6559-3fde-3fa30ffb411e@yandex.ru> <83mtcgy44k.fsf@gnu.org> <83k07jx5jn.fsf@gnu.org> <866e510d-a060-7daa-d002-97861d056fa7@yandex.ru> <1144021660321893@iva5-64778ce1ba26.qloud-c.yandex.net> <12348081660379417@sas2-a098efd00d24.qloud-c.yandex.net> <66bbbb95983414e79637@heytings.org> <83wnbckp0q.fsf@gnu.org> <8e884ebe-2d2e-d599-15c3-a5cfe5e6b295@yandex.ru> <83o7wnl7ok.fsf@gnu.org> <036414cc-c711-efaf-ed5b-f8ccfaca0604@yandex.ru> <5900f20836753183a6ac@heytings.org> <5c22e38a-5dcd-860e-28a0-b4a5ede6a21b@yandex.ru> <877d3awb92.fsf@localhost> <87pmh2z277.fsf@localhost> 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="16516"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 56682@debbugs.gnu.org, Gregory Heytings , Eli Zaretskii , Dmitry Gutov To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 15 04:44:16 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 1oNQ5P-000449-Mv for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Aug 2022 04:44:15 +0200 Original-Received: from localhost ([::1]:59762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNQ5O-0006U0-NM for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 22:44:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNQ4E-0005S3-KT for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 22:43:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNQ4E-0002AQ-Bs for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 22:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNQ4D-0004OB-VD for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 22:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Aug 2022 02:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56682 X-GNU-PR-Package: emacs Original-Received: via spool by 56682-submit@debbugs.gnu.org id=B56682.166053132816808 (code B ref 56682); Mon, 15 Aug 2022 02:43:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 15 Aug 2022 02:42:08 +0000 Original-Received: from localhost ([127.0.0.1]:40181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNQ3L-0004N1-UY for submit@debbugs.gnu.org; Sun, 14 Aug 2022 22:42:08 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNQ3H-0004MW-Hq for 56682@debbugs.gnu.org; Sun, 14 Aug 2022 22:42:06 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DA0318051A; Sun, 14 Aug 2022 22:41:57 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6A25980389; Sun, 14 Aug 2022 22:41:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1660531312; bh=4VRpc++Ek6k+MRDXvBODjxU5cyIE/nUBF9oPMlHMmuA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=NAqi7LKwFMjJyQn1kX+j5t9N+b+f3HaAdDS4bhEavMAyC4i1yBncZD3kyiKl3INLM l7baQkUlv0hphTCLFa8DGL88on4JS6x/TE+qD+Aj8t64rT8oHSWxyCxIPsSa4DSR0u oaljzpmqbAnFEzFhkX3wnk7FV20VmrxtI+R3oVqUXYHiby0OQaZp3FjlAsr4QbrHSI sTaNq/jNEEX8lBrkNF01yOUZ+0LIWmNgFOo/k7Q3hohj9Gf14uAtpDOVRIZSm6PM/O DJh+DCJ1dkPaS3hQecdiuxeBLeUpw7KOnep4y4bKITDix6T9ncIMj1NAfmIwzVpDMP WV97qkPkDrRqA== Original-Received: from pastel (unknown [45.72.195.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 23DD012085D; Sun, 14 Aug 2022 22:41:52 -0400 (EDT) In-Reply-To: <87pmh2z277.fsf@localhost> (Ihor Radchenko's message of "Mon, 15 Aug 2022 10:10:36 +0800") 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:239718 Archived-At: >>> This is needed by Org parser to determine the syntax element at point. >> But font-lock widens before using Org-mode's `font-lock-keywords`, so >> there should be no need for Org-mode to widen in that case. > Yes, but Org parser is not written explicitly for font-locking purposes. > org-element-at-point knows nothing about buffer restriction upon > calling and thus has to widen to ensure correctness. That will break uses of MMM-mode where one of the chunks is using Org-mode. Admittedly, this is unlikely, but still: It would be much better to arrange to do `widen` *outside* of Org-mode's font-lock (and indentation) code. >> PS: Not sure if Org-mode qualifies as a mode that is likely to suffer >> from the kinds of long-lines or large-file problems that Gregory has >> tried to tackle, tho. I've never seen an Org file with lines >10kB nor >> an Org file larger than 10MB. > > I have seen very long lines in Org. Specifically, in source block > output. (http query) > > My notes.org file is over 20Mb. > Even larger files can be auto-generated by https://gitlab.com/publicvoit/Memacs I stand corrected, Stefan