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: font-lock-fontify-block Date: Thu, 11 Mar 2021 17:14:02 -0500 Message-ID: References: <87a6sbg41o.fsf@gnus.org> <87lfatirk1.fsf@gnus.org> <83blbpmy2x.fsf@gnu.org> <837dmdmw60.fsf@gnu.org> <831rclmoy0.fsf@gnu.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="35037"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: larsi@gnus.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 11 23:16:06 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 1lKTbB-0008zN-I4 for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Mar 2021 23:16:05 +0100 Original-Received: from localhost ([::1]:50996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKTbA-000323-Ji for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Mar 2021 17:16:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKTZJ-00023m-36 for emacs-devel@gnu.org; Thu, 11 Mar 2021 17:14:09 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKTZG-00023r-FK; Thu, 11 Mar 2021 17:14:08 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AC2E4440B49; Thu, 11 Mar 2021 17:14:04 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0FEF2440B22; Thu, 11 Mar 2021 17:14:03 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1615500843; bh=rhIrEBuGDNAxk9h1CmfXSjrltGqwc1Rjv7fjnP7eQZ8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=iXJ4hdh7HEHaZOfIe5//zAJ1Qzifc4XtnV254syZQWt3YFBL3tsn+WM9dZysaWbqd tvS0HA6xX0uiorzhfoLoTKKCHNA3nGrt6js0UM2hc1pV0+gGJyqQFQiEEeucf2Ky9A IZy5vIuOYYFmdkt9Xx/AAKjzKqzwhA9BQ/Xm43TXRILkoPKtJSt5HINJ2B6HsJQAfw KlpOStgorfGeSilz1Oz5VmQQ/5HJjeQwX6ww8ThTvFotGAqMFSJcg75JGMplRaoK8M 7xhKdATXNjF16NGWdojwYM/eyYLq0WymUhMgnWIGMY4Q9erus0NispBKHZhh+aCMNd /jM1kBtLO3YtA== Original-Received: from alfajor (unknown [216.154.43.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D69721204BA; Thu, 11 Mar 2021 17:14:02 -0500 (EST) In-Reply-To: <831rclmoy0.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 11 Mar 2021 22:10:31 +0200") 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:266367 Archived-At: >> Do you have some general idea of what are the most common reasons for >> the temporary mis-fontification? >> AFAIK usually misfontifications aren't temporary unless they're linked >> to some multiline element, most commonly an unclosed string or comment >> and those should get fixed automatically after a short delay. > Probably. But also when fontification is highly context-dependent, I > think. Hmm... I winder what those situations are like. If/when you can think of examples, that would be very helpful, thanks. >> So is it the case that the cases where you needed `M-o M-o` would >> fix themselves after a short delay anyway (I'm OK with keeping such >> a command for the case you don't want to wait, I'm just trying to >> understand what it is that `M-o M-o` corrects). > No, in most cases where I used it, the delay isn't short. More like > infinite. So they really correspond to what I would consider as bugs (some of which might be known and we don't really know how to fix). >> Would you be OK with the idea of deprecating the use of >> `font-lock-fontify-block' for the specific case where font-lock is >> not enabled? > I only ever use it in that case to _remove_ the faces from text yanked > from a fontified buffer. So that's another important use case for > M-o M-o. Oh, that never occurred to me. I generally just "live with it". >> Also, I suspect that for your use case, we could have a general >> "refresh" command, which just calls `font-lock-flush`, which would not >> depend on the ill-defined notion of "block" (and wouldn't mess with the >> mark). > > I'd have to use it for a while to have an opinion. For the "yank into text-mode" case, I guess we'd still need to limit the effect, either via the use of the notion of "block" or by requiring to select a region. Stefan