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: Fri, 29 Jul 2022 18:27:06 +0000 Message-ID: References: <83bktghrn0.fsf@gnu.org> <8a3eaeef010995a5da8d@heytings.org> <837d40ds09.fsf@gnu.org> <83zggwcby5.fsf@gnu.org> <83o7xccagi.fsf@gnu.org> <831qu7daxb.fsf@gnu.org> <83sfmnb7yg.fsf@gnu.org> <837d3ybh5z.fsf@gnu.org> <136c4fe0fc74196714aa@heytings.org> <83pmhp89ov.fsf@gnu.org> <136c4fe0fc39573addc9@heytings.org> <83k07x8738.fsf@gnu.org> <136c4fe0fcdf00ef9a11@heytings.org> <83h73183r7.fsf@gnu.org> <136c4fe0fc0fceb0d752@heytings.org> <838roc8ka7.fsf@gnu.org> <83tu706obt.fsf@gnu.org> <83h7306ifa.fsf@gnu.org> <83edy37pul.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32576"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, 56682@debbugs.gnu.org, larsi@gnus.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 29 20:28:10 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 1oHUiX-0008Ag-ID for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Jul 2022 20:28:09 +0200 Original-Received: from localhost ([::1]:58292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHUiW-0001BS-MS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Jul 2022 14:28:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHUiQ-0001BE-PP for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 14:28:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHUiQ-00029g-GO for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 14:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oHUiQ-0006AR-Cz for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 14:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Jul 2022 18:28: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.165911923923652 (code B ref 56682); Fri, 29 Jul 2022 18:28:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 29 Jul 2022 18:27:19 +0000 Original-Received: from localhost ([127.0.0.1]:33441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHUhf-00069L-T4 for submit@debbugs.gnu.org; Fri, 29 Jul 2022 14:27:19 -0400 Original-Received: from heytings.org ([95.142.160.155]:58048) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHUhY-000696-1t for 56682@debbugs.gnu.org; Fri, 29 Jul 2022 14:27:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1659119226; bh=JqGe+qpiqOgPE7avTXiseLofh6g8YgwrBt4qczuen5M=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=e5JIWMjrN9ulAtzQjGaLQTGh6ea+HzmOmqwS7vne+hjswNM8LYAQ+wYiZRqn4Z4uA IuIiRzyxMIp4U/2UAOJvA4lz5+std2fvTrMfQuY0h8fakQjuIrHGo5PMmhg1fVO1Jr pBFp0DUEECKoXMbLv8RJOa9SKA6LtyK4CZzHeh2f11Vw1NEVsYbVa5UarFHSMGzT1K 3zLGFFnl04wmt6b6Mr+xAkwRD0mxA+GSXMq7MxmW+rzeSKetUX/2xu/q6BQCWvcDFh ONVNIK2ZrA0stmY0oUQfPoUVlcyr8o9Z3GGEHq5M8Uf6edWgsAq2xDzRmPiVPvMZNJ ZRkCGmENPOHMQ== In-Reply-To: <83edy37pul.fsf@gnu.org> 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:238210 Archived-At: >> I don't know yet if it's necessary to add another similar recomputation >> inside init_iterator. > > I'll play with other callers of init_iterator and start_display, and see > if they can do similar things. > In case this helps, it is easy to enter the following conditional, for example with C-s, or with your previous M-g c 20000 and M-: (vertical-motion 200) RET recipe (in both steps). It's not clear to me if updating the narrowing bounds there has an actual impact. At least applying that change does not seem to have negative effects. diff --git a/src/xdisp.c b/src/xdisp.c index b1ee7889d4..e415320a52 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3429,6 +3429,12 @@ init_iterator (struct it *it, struct window *w, { it->narrowed_begv = get_narrowed_begv (w, window_point (w)); it->narrowed_zv = get_narrowed_zv (w, window_point (w)); + if (charpos >= 0 + && (charpos < it->narrowed_begv || charpos > it->narrowed_zv)) + { + it->narrowed_begv = get_narrowed_begv (w, charpos); + it->narrowed_zv = get_narrowed_zv (w, charpos); + } } /* If a buffer position was specified, set the iterator there,