From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#56682: Fix the long lines font locking related slowdowns Date: Mon, 01 Aug 2022 07:51:12 +0000 Message-ID: References: <837d46mjen.fsf@gnu.org> <8a3eaeef01be5bfaa5ef@heytings.org> <05388e8d8812bfa3695d@heytings.org> <83v8rf5894.fsf@gnu.org> <65cb7c73fd4a999cca00@heytings.org> <8c7321f2f3400a5db9be@heytings.org> <8c7321f2f388e5343475@heytings.org> <8c7321f2f36494299e61@heytings.org> <8c7321f2f336523624e3@heytings.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="28C9KXxW0r" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21902"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, Eli Zaretskii To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 01 09:52:42 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 1oIQED-0005W3-Ql for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Aug 2022 09:52:42 +0200 Original-Received: from localhost ([::1]:35550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIQEB-0006Z8-RP for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Aug 2022 03:52:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIQDd-0006Y6-Ma for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 03:52:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49406) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIQDZ-0003iD-Qb for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 03:52:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIQDZ-0007Be-KI for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 03:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Aug 2022 07:52: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.165934027727552 (code B ref 56682); Mon, 01 Aug 2022 07:52:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 1 Aug 2022 07:51:17 +0000 Original-Received: from localhost ([127.0.0.1]:39155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIQCr-0007AJ-Ej for submit@debbugs.gnu.org; Mon, 01 Aug 2022 03:51:17 -0400 Original-Received: from heytings.org ([95.142.160.155]:33362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIQCp-0007AA-6I for 56682@debbugs.gnu.org; Mon, 01 Aug 2022 03:51:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1659340274; bh=9VOLd9OKFQiOvIsBmEM582g0ISAUDNmGLh5qTkuzDXo=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=6vBIVhhxEapvgbT0HSCpQGCTbLqHOYGWO93cfbGMMAfCp/dzWzJstkaRHlp2JM2rH cQnPLtW3dL5d/lLas2wiN9zqOWHrn6MK2YF70WnJCpIHSEh2vTryDZpQu1FTbaOaie qqAYhBEEEmtWd190yxWyY2DUoAZr9qf6tsRqJbMutDoJn8XuIwz1CjGZyr6mKyE5B7 qtChDOnzlHFgUhbLPBRo48ayz+ME85ukzrJA7kF+5m1TIRY69ZXSFfWEc9q+9l2HaY wuZcV8v+lYYPENtBIXvG+WgKMyWT1poXwi/ClINlTSbCZ4xHZYE2QVtjItcJStNXIQ q/35UQcAcxFcw== In-Reply-To: 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:238390 Archived-At: --28C9KXxW0r Content-Type: text/plain; format=flowed; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>> Your current code makes it impossible for a major mode to make Emacs=20 >>> slow by widening in a too-long-line. >> >> Which is a good thing, isn't it? > > No: we don't want to prevent people from shooting themselves in the=20 > foot. Basically if it says "impossible" there's a good chance it's not a= =20 > good thing. > Apparently you don't understand what I'm doing. I'm trying to make Emacs= =20 handle exceptional cases gracefully, by: 1. adding as few hard limits as possible, and 2. keeping as many functionalities as possible (my task would have been _a= =20 lot_ easier if I had just stopped after saying "just open these files with= =20 M-x find-file-literally"). If you think there's anything wrong with that approach, I'll have to=20 conclude that we live on different planets. On Earth and on Theory,=20 maybe? And no, it's not even "impossible" for Emacs uses to shoot themselves in=20 the foot, so your argument collapses. Those who prefer the "Traditional=20 Emacs Approach"=E2=84=A2 when it encounters such exceptional cases, that is= ,=20 those who: 1. do not want to add any limits whatsoever in any circumstance, and 2. agree to take the risk of making Emacs completely unfonctional, can simply add (setq long-line-threshold nil) in their init file. >> I just sent one such example to Dmitry. And I pointed to another=20 >> possible solution, namely to scan the whole buffer while opening it=20 >> (instead of scanning it lazily, which is IIUC what currently happens).= =20 >> From a user viewpoint, it's understandable that opening a big file=20 >> takes some time. > > We used to scan eagerly in the background with `jit-lock-stealth`, but=20 > that was not very popular (eats up your battery for fairly little=20 > benefit). We also have "lazier" highlighting via `jit-lock-defer`, but=20 > that hasn't been adapted to `syntax-ppss`. It might be worth=20 > investigating. > It might be, indeed. But I will most probably not do that myself. --28C9KXxW0r--