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: Mon, 29 Mar 2021 09:00:31 -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="4096"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 29 15:02:32 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 1lQrXL-0000xa-3U for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Mar 2021 15:02:31 +0200 Original-Received: from localhost ([::1]:52256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQrXK-0007Ua-4O for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Mar 2021 09:02:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQrVc-0006ke-1u for emacs-devel@gnu.org; Mon, 29 Mar 2021 09:00:44 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37257) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQrVW-0004JL-Uc for emacs-devel@gnu.org; Mon, 29 Mar 2021 09:00:42 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5AC4910021D; Mon, 29 Mar 2021 09:00:34 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id EB87A1000F4; Mon, 29 Mar 2021 09:00:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1617022832; bh=vZItn//RvK2QRJMll/Sv2Ep3+m4pUs6UruIclPxT5/I=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=paqt7I3x00hxfNmLsx9Cj3rTy1vDWVm2MorcD+yYt8h5/bK+I+rr8g3vEUvWgFYcJ SsS1zOpqJJ0rfKqVMtuNjM5WuuPKKrE+qiBCLl4htRi4lt2NhYp6kDiSiMtJLR3/8k VrFnim+udOvwRy90G45A2xbfCrzLNIHW+DW0hF/Mkg1eKi6EXdl8VH6WSyQKT4ZXY3 MYUKrhLcQW+UZfwdOJzcjl2Z4Cwx2jFG+7VSYCbmkrH311RI+mZCd6Z4iokJZsnCRu yEpwGYOfvXxSBzfhFcMmSEzP8VnrpEsfCCVcNjDHaHgKMdTFd0SIMNc9qatNnA9+Xw qDu/7dGi2ttPg== Original-Received: from alfajor (unknown [216.154.43.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C0E201203C3; Mon, 29 Mar 2021 09:00:32 -0400 (EDT) In-Reply-To: (Gregory Heytings's message of "Mon, 29 Mar 2021 09:44:03 +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:267150 Archived-At: > One thing I'm not entirely sure is whether the > second case is (and font-lock-mode (not font-lock-keywords)) or (and > font-lock-mode (not font-lock-fontified)), but my guess is that > font-lock-fontified is an internal variable and that it is safer to use > font-lock-keywords here. I'm not entirely sure what is the best way to detect this middle-point either. The code that decides whether to activate the font-lock machinery calls `font-lock-specified-p` for that, but maybe there are corner cases where the machinery can be activated even when `font-lock-specified-p` returns nil? Similarly, I'm not sure if `font-lock-fontified` is always non-nil when the font-lock machinery is activated and always nil when it isn't. IOW, someone needs to look carefully at the code to find out (and presumably then document the result e.g. by adding a function that returns this info, or with comments, or by adding a variable which keeps track of this info or ...). >>> +Otherwise, with prefix ARG, toggle Font Lock mode." >> Is this behavior useful? > I think it is, yes, and I think it makes sense to use the prefix argument > for that. M-x font-lock-mode does not always produce the expected effect, > which can be puzzling, so having a way to "do what I mean" in a command > is useful. Could you describe what you mean by "does not always produce the expected effect" here? [ And maybe how the prefix ARG to `font-lock-dwim` avoids those problems? ] Stefan