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#58888: 28.1.90; font-lock-defaults not respected when hack-local-variables unsafe variable dialogue is displayed before setting the defaults Date: Mon, 08 Apr 2024 08:48:36 -0400 Message-ID: References: <878rkxajcs.fsf@localhost> <87cza8jwm6.fsf@localhost> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40195"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 58888@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 08 14:49:26 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 1rtoRB-000AEa-PT for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Apr 2024 14:49:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtoQm-0007M0-4Y; Mon, 08 Apr 2024 08:49:00 -0400 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 1rtoQi-0007LJ-6q for bug-gnu-emacs@gnu.org; Mon, 08 Apr 2024 08:48:57 -0400 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 1rtoQh-0003z7-Sq for bug-gnu-emacs@gnu.org; Mon, 08 Apr 2024 08:48:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rtoQp-0000Xa-8z for bug-gnu-emacs@gnu.org; Mon, 08 Apr 2024 08:49:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Apr 2024 12:49:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58888 X-GNU-PR-Package: emacs Original-Received: via spool by 58888-submit@debbugs.gnu.org id=B58888.17125805382026 (code B ref 58888); Mon, 08 Apr 2024 12:49:03 +0000 Original-Received: (at 58888) by debbugs.gnu.org; 8 Apr 2024 12:48:58 +0000 Original-Received: from localhost ([127.0.0.1]:45551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtoQi-0000WL-H4 for submit@debbugs.gnu.org; Mon, 08 Apr 2024 08:48:57 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23911) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtoQe-0000Uk-L5 for 58888@debbugs.gnu.org; Mon, 08 Apr 2024 08:48:54 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B16DA1000DD; Mon, 8 Apr 2024 08:48:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1712580517; bh=C3TxZqzEU60FAAQtrJw+ZIeok4RhuGm0W2Q3vRmXIMQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Bzd6UIl6hMozI9y6Pqd1WmgDfRVR3sc+fyNCNRpNcHO5zq0+7Trd2rxc7FvrTR4G/ ZXPYLLpTvNiFKkOctjTV6UtR8KOAGUf3yu8da9jePFGWEDdBepuV+3VZKj+x0JBqXU VuD0d/JU1ACQMPTlwnaR1jVP/Qx0NEzOGKSie0NBL7GrN432bBRUZpPp66KTHET/57 XpoDl0Bzdymr/lUWmL61IVCMpDyYtSBX0khI2ZXSrL4n0/UwCnTzSu7vrJcQQ+vTwr fabqz3MwgdvPYAeq8a6KOK1di4bMWNxgwu6n6kNl8y5dmIJ9N7TXH+t/3tdhw6/uBA S4WeXcaIxy+Bg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9C79E100046; Mon, 8 Apr 2024 08:48:37 -0400 (EDT) Original-Received: from pastel (unknown [45.72.201.215]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7725A120484; Mon, 8 Apr 2024 08:48:37 -0400 (EDT) In-Reply-To: <87cza8jwm6.fsf@localhost> (Ihor Radchenko's message of "Mon, 31 Oct 2022 07:11:29 +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:282936 Archived-At: --=-=-= Content-Type: text/plain >> Hmm... AFAICT the problem here is that the implementation of >> `global-font-lock-mode` ends up trying to enable `font-lock-mode` in >> that file's buffer during execution of the >> `after-major-mode-change-hook` of *another* buffer while querying >> whether to obey those file-local settings, and then fails to try again >> when the hook is run in the desired buffer. >> >> I suspect the patch below might help (requires recompiling >> `font-core.el` and re-dumping Emacs), but as the comment in there >> explains it might not always be sufficient either. > > I tried the patch via make extraclean; make bootstrap > I can still reproduce the original recipe. I pushed that patch to m`aster` because it fixed other cases (e.g. bug#69431) but I think to fix bug#58888 we need the next step, which is the patch below. Can you confirm that it fixes it for you as well? It will remove support for globalized minor modes in those few remaining major modes which don't use `run-mode-hooks`. `run-mode-hooks` was introduced in Emacs-22 and for many years it was really important to support modes which don't use it, but nowadays those modes are vanishingly rare and really should get fixed, so I think it's time to get rid of those ugly hacks. Stefan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=easy-mmode.patch --=-=-=--