From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68849: 30.0.50; font-lock does not flush fontification after calling open-line Date: Sat, 03 Feb 2024 13:46:58 -0500 Message-ID: References: <875xz9oep2.fsf@localhost> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36281"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 68849@debbugs.gnu.org, Kostas Papadakis To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 03 19:48:05 2024 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 1rWL3d-0009CL-3G for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Feb 2024 19:48:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rWL3R-0004Ea-2A; Sat, 03 Feb 2024 13:47:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rWL3O-0004ED-HC for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2024 13:47:50 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rWL3O-00047l-8r for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2024 13:47:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rWL3Z-0002hM-Ms for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2024 13:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Feb 2024 18:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68849 X-GNU-PR-Package: emacs Original-Received: via spool by 68849-submit@debbugs.gnu.org id=B68849.170698604110241 (code B ref 68849); Sat, 03 Feb 2024 18:48:01 +0000 Original-Received: (at 68849) by debbugs.gnu.org; 3 Feb 2024 18:47:21 +0000 Original-Received: from localhost ([127.0.0.1]:47073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWL2v-0002f7-2O for submit@debbugs.gnu.org; Sat, 03 Feb 2024 13:47:21 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:6882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWL2s-0002eq-Co for 68849@debbugs.gnu.org; Sat, 03 Feb 2024 13:47:19 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9A2B710035E; Sat, 3 Feb 2024 13:47:00 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1706986019; bh=hxiDJkBcRLDF333Pai2cMjxQSLTGLAqomU8dmiPZi20=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dJxghZov0EwRRFVTrDyWQdMp/Oc33f/0E1BaAAfUwyK3xsrc7H9FN/ks0wsTAv+yS pka+cDui+f4dvCePGcFrpLhDX9/3aGT73iXHDFqt04JrjQPmgRSIxZ27i62wtt6ouE wN41fhKDvBCGy/W4GpzBGacHCibUVARL87XK1gcUn8HrGzD7pqEDsi9bV/5vBoKgA/ HIvAJFSw81iY5Bj1YIe9dCTcCvqBzXqghT0Yph+wHanb6e4xyr/ROTlCXdXD/v/ajf X24UYgKTMOYeZXgFj2TEEv5fsANNfpJq128VcfQ4rjKD/0c7ByfqnqvNWxK0oV5YQo gXq2TvVsGB3Xg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id AD1B11002EA; Sat, 3 Feb 2024 13:46:59 -0500 (EST) Original-Received: from alfajor (69-165-153-17.dsl.teksavvy.com [69.165.153.17]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7E2C91201E7; Sat, 3 Feb 2024 13:46:59 -0500 (EST) In-Reply-To: <875xz9oep2.fsf@localhost> (Ihor Radchenko's message of "Wed, 31 Jan 2024 12:44:09 +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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279377 Archived-At: > I am not 100% sure if is Emacs bug, but my preliminary testing showed > anomalies in `jit-lock-after-change' - > (put-text-property jit-lock-start jit-lock-end 'fontified nil) somehow > did not apply the text properties. I suspect that I missed something > though. AFAICT the `put-text-property` works fine :-) The problem is that your `org-fontify-extend-region` does not spread the change to the "next line". When `font-lock-extend-after-change-region-function` is nil, Emacs does that for you. Quoting `font-lock-extend-jit-lock-region-after-change`: (when (< end (point-max)) (setq end (cond ((get-text-property end 'font-lock-multiline) (or (text-property-any end (point-max) 'font-lock-multiline nil) (point-max))) ;; If `end' has been set by the function above, don't corrupt it. (font-lock-extend-after-change-region-function end) ;; Rounding up to a whole number of lines should include the ;; line right after `end'. Typical case: the first char of ;; the line was deleted. Or a \n was inserted in the middle ;; of a line. (t (1+ end))))) I still hope you can change Org mode so it uses `font-lock-extend-region-functions` instead of `font-lock-extend-after-change-region-function`. Stefan