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#57447: 28.1.90; Can font-lock stop requesting fontification of invisible text? Date: Sat, 27 Aug 2022 12:18:51 +0300 Message-ID: <831qt211tw.fsf@gnu.org> References: <87fshi6ygu.fsf@localhost> <837d2u184w.fsf@gnu.org> <87bks66sfk.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2232"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57447@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 27 11:24:55 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 1oRs3i-0000PY-Po for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Aug 2022 11:24:54 +0200 Original-Received: from localhost ([::1]:47936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRs3h-0000ML-SF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Aug 2022 05:24:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRry2-0003cT-Sj for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2022 05:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37194) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oRry2-0000CH-EF for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2022 05:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oRry2-0005Kd-1t for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2022 05:19: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, 27 Aug 2022 09:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57447 X-GNU-PR-Package: emacs Original-Received: via spool by 57447-submit@debbugs.gnu.org id=B57447.166159192220468 (code B ref 57447); Sat, 27 Aug 2022 09:19:02 +0000 Original-Received: (at 57447) by debbugs.gnu.org; 27 Aug 2022 09:18:42 +0000 Original-Received: from localhost ([127.0.0.1]:55176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRrxi-0005K4-FQ for submit@debbugs.gnu.org; Sat, 27 Aug 2022 05:18:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRrxh-0005Jp-HI for 57447@debbugs.gnu.org; Sat, 27 Aug 2022 05:18:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55718) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRrxb-00009w-Vp; Sat, 27 Aug 2022 05:18: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=9QbFNq5j8TX5Zn8wYvQhxRUtxGgNmG2++rZXESQJlNY=; b=MIl4+JEMaD1b +U7vBK/DkT329E+eN90FmHJEXjctB9bx0vNW9407GN6pBwS6p8Sef7pAvVzzg7609oBokYtn2h8JM 37mNkJF8XNEQbtMk0RU0AsRKsVYeVI5H1rG+YzcQQvnqpuaDvRuOdYBZ2SpbWUVd2FU3BEb28sBj/ tsrq615lGu/91o0bVbi17a74wPWAYB4MbSPVb3qcL5e+BkWEhn9lq8mylpxDXdn8OVuXM0zTglkUC DSCW7COSUOddJy/CzfgmM7PWJ5Ol8FGKR7D4qymVXhEmiDY8z7BjyFhg8AKqqBPPwTk2vrYYd/BhO QQeRsjhinf7PQirlTC6mFQ==; Original-Received: from [87.69.77.57] (port=2644 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 1oRrxb-0002DD-Ff; Sat, 27 Aug 2022 05:18:35 -0400 In-Reply-To: <87bks66sfk.fsf@localhost> (message from Ihor Radchenko on Sat, 27 Aug 2022 15:45:19 +0800) 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:240887 Archived-At: > From: Ihor Radchenko > Cc: 57447@debbugs.gnu.org > Date: Sat, 27 Aug 2022 15:45:19 +0800 > > I did expect some invisible text to be fontified, but did not expect 10x > increase in the requested text size. The increase depends on how much text is hidden in each chunk, relative to jit-lock-chunk-size. If you have a lot of small shunks of hidden text interspersed with visible text, you could have all of the invisible text fontified. > > One way this could be improved is by making jit-lock-chunk-size > > smaller. This will make the probability of such "over-fontification" > > lower. > > I tried to reduce the chunk size and at appears to help. However, I am > not sure if there are other side effects of reducing > jit-lock-chunk-size. If the size is smaller than the visible portion of the buffer, it will cause repeated calls to fontification-functions, instead of just one call. If fontification-functions do their job in approximately linear time, you shouldn't see any adverse effects, I think. But if each call to fontification-functions incurs some one-time overhead that is relatively expensive, the result could be slower redisplay when the window is scrolled a lot. > The code producing the messages is in > https://github.com/yantar92/org/blob/feature/org-font-lock-element/lisp/org-font-lock-core.el > Search for org-font-lock-verbose in the code. > > If you want to test it yourself, clone https://github.com/yantar92/org > and use feature/org-font-lock-element branch with the file I provided, > unfold the "Home" headline, and then unfold the "Ideas ..." headline. I only want to test that if you see something that is inconsistent with my description of how this stuff works, including the value of jit-lock-chunk-size.