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: Tue, 16 Aug 2022 09:20:21 -0400 Message-ID: References: <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> <87mtc6yzfv.fsf@localhost> <6be37aac-f305-16e0-b856-6884108f940e@yandex.ru> <87h72d4slv.fsf@localhost> <87tu6czu4y.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="1869"; 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 Tue Aug 16 15:23:30 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 1oNwXZ-0000Ej-E0 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 15:23:29 +0200 Original-Received: from localhost ([::1]:51984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNwXX-00038X-VH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 09:23:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNwVD-00006Y-5j for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 09:21:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNwVC-0001o5-KR for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 09:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNwVC-00013b-Gd for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 09:21: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: Tue, 16 Aug 2022 13:21:02 +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.16606560324005 (code B ref 56682); Tue, 16 Aug 2022 13:21:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 16 Aug 2022 13:20:32 +0000 Original-Received: from localhost ([127.0.0.1]:45297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNwUh-00012W-SH for submit@debbugs.gnu.org; Tue, 16 Aug 2022 09:20:32 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNwUg-00012G-BS for 56682@debbugs.gnu.org; Tue, 16 Aug 2022 09:20:30 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DB26B4410A1; Tue, 16 Aug 2022 09:20:24 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 82BCE440F5E; Tue, 16 Aug 2022 09:20:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1660656023; bh=qqTqi3VL9KcSVoz5MBHBoogPfbtl1lnKjMj0knCiQjo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=n3R3ICjWbUIQ6daagyCFZcBCXYigG/S7TZMJw2x53xNbSBOhNrNS6T8oAYas/Nbsj u6WMj2Mb+MxhgEL2fWQAPqEyJHNG3B6vyNbi+LT3rr7ljMLdCJ5RrSkIGb+k1fJ61B o4Fx+fQXjliKRqI8JI0eV1JV3kqx906FD45VV+C6R+lnHoxcbeAzVOSUEjAg9aWSCu bnewxOs5d3c9qWwycKeGtWDqFaOlemZBqo6+A1Uq2zzr3VApJV4YEhfSidmxZkMRmN RXoTuE5XV0YlWGBnZsDNunYTmr1elwVDFbgwn1a1zomdVYU/FuASOPKLMhWFnBtybR 5UYYcK84lnUKQ== Original-Received: from pastel (unknown [45.72.195.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 49BD912023A; Tue, 16 Aug 2022 09:20:23 -0400 (EDT) In-Reply-To: <87tu6czu4y.fsf@localhost> (Ihor Radchenko's message of "Tue, 16 Aug 2022 12:31:41 +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:239930 Archived-At: > I agree that major-mode doing (widen) may be problematic. However, at > least Org mode does need to do it in order to parse the buffer. There's no doubt that a major mode may need to override a user's narrowing in order to work correctly. That doesn't mean that it absolutely always needs to have access to the whole buffer. >>> There are valid cases when a major mode needs to examine >>> the whole buffer. >> Not if the whole buffer contains text which the major mode can't >> understand. There are valid cases where a major mode needs to widen, >> indeed, but not when called from font-lock or from >> `indent-line-function`. > `org-indent-line' (the value of `indent-line-function' in Org mode) does > require invoking parser in order to determine the syntactic object at > point, which, in turn, needs to consider the full buffer contents. *All* indentation code needs to look at the context. For that reason `indent-according-to-mode` already widens as appropriate before calling `indent-line-function`. For that reason the function placed on `indent-line-function` *never* needs to widen (and should never widen). Stefan