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: Fri, 29 Jul 2022 16:27:50 +0300 Message-ID: <83tu706obt.fsf@gnu.org> References: <837d46mjen.fsf@gnu.org> <174616cd5c33bfc14b1f@heytings.org> <837d44jr4p.fsf@gnu.org> <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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16338"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, 56682-done@debbugs.gnu.org, larsi@gnus.org, monnier@iro.umontreal.ca To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 29 15:32:03 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 1oHQ5z-00045u-CV for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Jul 2022 15:32:03 +0200 Original-Received: from localhost ([::1]:35914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHQ5y-0001ud-AC for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Jul 2022 09:32:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHQ27-0007Ln-Dp for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 09:28:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42175) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHQ25-0006yD-VM for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 09:28:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oHQ25-0005y3-PA for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 09:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Jul 2022 13:28: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-done@debbugs.gnu.org id=D56682.165910127122921 (code D ref 56682); Fri, 29 Jul 2022 13:28:01 +0000 Original-Received: (at 56682-done) by debbugs.gnu.org; 29 Jul 2022 13:27:51 +0000 Original-Received: from localhost ([127.0.0.1]:60157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHQ1u-0005xc-GR for submit@debbugs.gnu.org; Fri, 29 Jul 2022 09:27:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHQ1s-0005xO-43 for 56682-done@debbugs.gnu.org; Fri, 29 Jul 2022 09:27:49 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHQ1k-0006we-FC; Fri, 29 Jul 2022 09:27:40 -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=Tkiujj5Z1jBYX2xPeu/mf3ARCS2GyFuT5r6GAre0Ua8=; b=fgUgtxg4u0gi GyWXT1VaZrHLbzr9gKPNBmcooR2qb+fQnGc6L0d0ipmIYonVyUkhsEBc0INDCTAmekexlfzuiOIJP ixK0QuPKGPtOSe5vo/x074m3bWg+n9dGPFDaDUKbXwwHSBGN3Od5osS+9LaBDlRx93h0md9rjhcAr nBu5ew2C2cQ5RqgF3ZAaOAzEuIfVWGlAJpP7ZNQ1sfASmGHBXLc1BPnjSriawbsEAM/ospHdpknlH zhk2x0wuR4xmGmv07qPfLxTXZl8hAvsZTDKTea5Xjy//cppSusgkzPBTg0HV5QjoS2Jtx37bEEVA8 1RE0AGcJ+/7+e5AmhCbR5A==; Original-Received: from [87.69.77.57] (port=4302 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 1oHQ1j-0004n7-Fr; Fri, 29 Jul 2022 09:27:40 -0400 In-Reply-To: (message from Gregory Heytings on Fri, 29 Jul 2022 08:33:38 +0000) 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:238164 Archived-At: > Date: Fri, 29 Jul 2022 08:33:38 +0000 > From: Gregory Heytings > cc: gerd.moellmann@gmail.com, 56682-done@debbugs.gnu.org, larsi@gnus.org, > monnier@iro.umontreal.ca > > Now done, and closing this bug. Hmm... I'm bothered by this code in handle_fontified_prop: if (it->narrowed_begv) Fnarrow_to_region (make_fixnum (it->narrowed_begv), make_fixnum (it->narrowed_zv), Qt); This narrows the buffer around window's point position (since this is how narrowed_begv and narrowed_zv are computed), but the display iterator can be called for position outside this range. This is unlikely to happen when the function is called as part of actual redisplay of a window, but it can easily happen when the display code is used by other primitives, for example vertical-motion or pos-visible-in-window-p. What happens then is that fontification-functions are called with the argument POS that is outside of the restriction, and that can cause errors. (jit-lock simply does nothing in that case, AFAICT.) Is this intended?