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: Sat, 30 Jul 2022 12:05:47 +0300 Message-ID: <83pmhn55sk.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17354"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, 56682@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 Sat Jul 30 11:06:31 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 1oHiQY-0004NN-Ny for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Jul 2022 11:06:30 +0200 Original-Received: from localhost ([::1]:56000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHiQX-0000HL-Pl for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Jul 2022 05:06:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHiQ8-0000GQ-CI for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 05:06:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44275) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHiQ6-0006UI-IT for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 05:06:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oHiQ6-0000On-Ca for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 05:06: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: Sat, 30 Jul 2022 09:06: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.16591719611526 (code B ref 56682); Sat, 30 Jul 2022 09:06:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 30 Jul 2022 09:06:01 +0000 Original-Received: from localhost ([127.0.0.1]:34024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHiQ4-0000OX-UO for submit@debbugs.gnu.org; Sat, 30 Jul 2022 05:06:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHiQ3-0000OH-Bl for 56682@debbugs.gnu.org; Sat, 30 Jul 2022 05:05:59 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHiPx-0006SI-E3; Sat, 30 Jul 2022 05:05:53 -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=vuyatjofOX7Za7isx6JX828H9kVEzWagMCErLDM4qHM=; b=E18fZGqRgL8k x/BIFtcI2bhKsj9MuZat6Ei7CVUMgxnqeKDd4qtkMLtYHYlV6eKG6UsZmy8eFvc/ZZzBjhNMG58db z/GnG6oHPC7ldzRfZp5oxF8rlhTmSYRbnQ77TyTYrt0+2bamobKtTrQXgvaryF/v9xztZ6P9GOv3k sAjdrIATxz/ZNGWuVGryJ8lZwsMMg9zICjVo3r7erh/EZcGqdNY3EeMarQJzx+wDEY6oo0Z/9ofkR S48UsFc7U/6a4SfgqE7SqgUNLKqiiXgqg6Viw4ehblSn8e94tAfloMsi3ojFoSCRcxl3TFRnMFVor OT+DSQCWGF9gJ1QYLW6kvg==; Original-Received: from [87.69.77.57] (port=4966 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 1oHiPw-0005Dq-V9; Sat, 30 Jul 2022 05:05:53 -0400 In-Reply-To: (message from Gregory Heytings on Fri, 29 Jul 2022 20:02:47 +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:238244 Archived-At: > Date: Fri, 29 Jul 2022 20:02:47 +0000 > From: Gregory Heytings > cc: gerd.moellmann@gmail.com, 56682@debbugs.gnu.org, larsi@gnus.org, > monnier@iro.umontreal.ca > > > Doing it in init_iterator is too early alas, with the above recipe at > > least init_iterator is called with charpos inside the narrowing bounds, > > after which the iterator moves outside the narrowing bounds. So I fixed > > the bug in handle_fontified_prop. > > Actually that doesn't work correctly. A recipe: > > emacs -Q > M-: (progn (set-frame-width nil 119) (set-frame-height nil 38)) RET > C-x C-f dictionary.json RET y > C-s aan SPC > > Now you'll see that the last line at the bottom of the window, which does > not contain "aan ", is highlighted. Is the following okay from your point > of view? I see the problem, but I don't understand how it could be related to handle_fontified_prop. The highlight in this case is the isearch highlighting of matches, and those are shown via overlays, not via face text properties, so AFAIK handle_fontified_prop doesn't handle them. Do you understand the relation of this to handle_fontified_prop? The immediate reason for the wrong highlighting seems to be an overlay whose end position is the match for "aan ", and whose start position is much earlier in the buffer (about 600K characters earlier). I don't yet understand why and how this overlay comes into existence. Hmm...