From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master 2399541: Remove font-lock toggle from font-lock-update Date: Thu, 25 Mar 2021 09:52:54 -0400 Message-ID: References: <20210324143048.23515.75257@vcs0.savannah.gnu.org> <20210324143050.40C6E20D10@vcs0.savannah.gnu.org> <8786a8e8fa731c1bd1ef@heytings.org> <87h7l0blrc.fsf@gnus.org> <87czvobksy.fsf@gnus.org> <87r1k4a1c0.fsf@gnus.org> <8786a8e8fa96815c66e3@heytings.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12238"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , "Paul W. Rankin" , emacs-devel@gnu.org To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 25 14:54:12 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lPQR9-000347-Qt for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Mar 2021 14:54:11 +0100 Original-Received: from localhost ([::1]:51852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPQR8-00031U-S7 for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Mar 2021 09:54:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPQQ5-0002ak-NY for emacs-devel@gnu.org; Thu, 25 Mar 2021 09:53:06 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25925) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPQPy-0005nW-LJ for emacs-devel@gnu.org; Thu, 25 Mar 2021 09:53:04 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AB7DC440AD0; Thu, 25 Mar 2021 09:52:57 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 13C8B4401DB; Thu, 25 Mar 2021 09:52:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1616680376; bh=0LGMSAV0iuplgIIDkP2q0kS0yGICBDqa35rquZrYyFI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=CWZ1Lahqe+6VVEctAsxiWcfanssp155ElY3rRKxfBtQWzdoMlcQJ1eqSvZ5DQ7LtR 45AEpFw0SYsfhjlcb+TJnY3FbK4GvUg65s346ssnraEyK8xOsoVkhKxv/JzAmJG9BG U1lSy/raIaiD+3wBJVqZWWBmnTT3px3fxi0nC+3rW4X+QL+WP4OWioUQ41rl3YowEt S1lksjLlWfhKIH9dFqKub5LG48Zw54c9oiT4XMVAJ6PFyhNPQGuz0a54k7fWaF/3YH kiQfBBdQczI/WQxs7C9fN8/NZlcqVa/YrllGaVlpYvGD6w3AeN9v3c/+5cDc2FRF/g Pse9e2t4uMnJg== Original-Received: from alfajor (unknown [216.154.43.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8CB8F120636; Thu, 25 Mar 2021 09:52:55 -0400 (EDT) In-Reply-To: <8786a8e8fa96815c66e3@heytings.org> (Gregory Heytings's message of "Wed, 24 Mar 2021 22:27:13 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267015 Archived-At: > Hmmm... You said: "`font-lock-fontify-region` is an important function > internally (it's the one and only function which performs font-locking, > fundamentally)". Is it wrong to use it nonetheless? That's the wrong question, since my beef is about the definition of what the function should do, as opposed to how it's implemented. [ Tho maybe I'd prefer if it used `font-lock-flush` or `font-lock-ensure`. ] >> I'd much prefer a longer `font-lock-fontify-diwm` which tries to reproduce >> more or less the same behavior as your favorite, but by explicitly testing >> the different circumstances you care about. > Could you perhaps give an example of such a circumstance and its > corresponding action? The main "circumstances" that matter are whether the font-lock machinery is activated and whether font-lock-mode is nil or not. The rest is more "obvious" (like whether it should pay attention to an active region, or only refresh the visible portion of the buffer, ...). Currently, I've heard mention of two use cases for font-lock-fontify-block: ;; - Correct misfontification when fontification is highly context-dependent ;; and has a bug (typically associated with multiline constructs). ;; `font-lock-flush` should work as well in that case. ;; - Removing fontification, e.g. when yanking font-locked strings into ;; a text-mode buffer. Not sure if the intention would be to generalize ;; this to all buffers with a nil `font-lock-keywords` or also to buffers ;; where font-lock-mode is disabled. Maybe the docstring should describe just those behaviors, and the implementation could then implement them explicitly, rather than have that grow accidentally as a result of the implementation. Stefan