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#56682: Fix the long lines font locking related slowdowns Date: Wed, 10 Aug 2022 22:13:28 +0300 Message-ID: <83zggbq5d3.fsf@gnu.org> References: <83h72qzheq.fsf@gnu.org> <25717d84-3411-a93a-3620-e04fe0571aff@yandex.ru> <83edxuzemr.fsf@gnu.org> <83a68hzz0a.fsf@gnu.org> <6ae35c93062c589b2e02@heytings.org> <7b7fbad7-55ac-49b8-840f-7f89a7e8771a@yandex.ru> <6ae35c93064b3588974c@heytings.org> <6ae35c9306c515f420d8@heytings.org> <87k07gwkjq.fsf@gmx.net> <87fsi4wiel.fsf@gmx.net> <837d3gs4p0.fsf@gnu.org> <83tu6kqnf1.fsf@gnu.org> <83fsi4qdxp.fsf@gnu.org> <2aa80c8f-5fb8-1892-72cd-60f050261104@yandex.ru> <838rnwqami.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8949"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, gregory@heytings.org, stephen.berman@gmx.net, monnier@iro.umontreal.ca To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 10 21:14: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 1oLr9k-0002B8-ID for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Aug 2022 21:14:16 +0200 Original-Received: from localhost ([::1]:60912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLr9j-0000Wf-Iu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Aug 2022 15:14:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLr9W-0000Rr-OA for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2022 15:14:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32808) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oLr9W-0003Jb-Ep for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2022 15:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oLr9W-0004o1-7W for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2022 15:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Aug 2022 19:14: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.166015882818446 (code B ref 56682); Wed, 10 Aug 2022 19:14:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 10 Aug 2022 19:13:48 +0000 Original-Received: from localhost ([127.0.0.1]:50790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLr9H-0004nR-8A for submit@debbugs.gnu.org; Wed, 10 Aug 2022 15:13:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLr9C-0004nB-4V for 56682@debbugs.gnu.org; Wed, 10 Aug 2022 15:13:45 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLr96-0003Fy-NF; Wed, 10 Aug 2022 15:13:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=GjOAoGzHcI/wsis2HOhJK3fu0RkAQIUiH6FlJk4C85k=; b=fecW3zdDfISE aC/8TY3Cbv3k4fCbcO/N99NxhRRgWtKpg1arAWbZ8SKk3YGjC5n0BSHlt5nQQZJv28bkaI3VsEd54 xZJLnEk09kWt+bR5Ww4G1/I0x2ZPlCAVI/iPdfERA0jmn10TlFxCVVjcCjeQEOU7srd8FQchC7FXj Lrj2wwzP7eI8jL8AR0dEniQK7aTs7mW9UZxnzzgdkvTNBenzAN0MizE/Y3K7slgsFDEay7dMgdjxI Zg5f/lxnp0WJ4rCRLdNphE/Us901TNRm6kRzbsqJUbtXXuy4WwwWw8fTg9H7Y8vZhYT+ElTSCxNvN EI9AjP/g7Gf8sEnY+jMWtA==; Original-Received: from [87.69.77.57] (port=4101 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 1oLr96-0004fw-5v; Wed, 10 Aug 2022 15:13:36 -0400 In-Reply-To: (message from Dmitry Gutov on Wed, 10 Aug 2022 21:54:04 +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:239318 Archived-At: > Date: Wed, 10 Aug 2022 21:54:04 +0300 > Cc: 56682@debbugs.gnu.org, gregory@heytings.org, stephen.berman@gmx.net, > monnier@iro.umontreal.ca > From: Dmitry Gutov > > > No, because font-lock is much more important than the effect of the > > BPA. (Do you even understand what the BPA does, and did you ever see > > it in action? Without that, this part of the discussion is just waste > > of time.) > > I have looked at examples now. Seems important for text in pertinent > human languages. Yes. Which JSON isn't. But most PL modes have comments and strings, and that's where this is important. > >> We could add (setq bidi-inhibit-bpa nil) to prog-mode, I suppose. > > > > Not to prog-mode, that I won't agree. But maybe for JSON files, if we > > think they are unlikely to suffer. > > Sure, maybe. > > Where do we draw the line, though? Not in prog-mode because a .js file, > say, can have comments in Persian or Hebrew? > > By that measurement, JSON is fine (no comments supported). But JSON > contains a bunch of strings, could store localizations, etc. I presume that JSON files are rarely for human consumption, so the strings are not very important. And they will rarely include R2L characters to begin with. > I suppose the contents of said strings can store i18n text, with the > expectation of a user being able to edit it. If and when that happens, users can turn BPA back on. > > There are no caches for a good reason: the Unicode Bidirectional > > Algorithm that we implement results in very far-reaching non-local > > effects of small changes. Even inserting or deleting a single > > character can dramatically change how the buffer looks on display very > > far from the locus of the change. > > In both directions? Yes (IIUC what you mean by that). The effect back happens rarer than forward, but it does happen.