From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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: Thu, 11 Apr 2024 09:20:33 +0300 Message-ID: <868r1kv2ry.fsf@gnu.org> References: <878rkxajcs.fsf@localhost> <87cza8jwm6.fsf@localhost> <87sezv3bct.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31379"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, 58888@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 11 08:21:12 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 1runo8-00080s-92 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Apr 2024 08:21:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1runnw-0001iN-Gm; Thu, 11 Apr 2024 02:21: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 1runns-0001hc-5e for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2024 02:20:58 -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 1runnr-0004KN-TX for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2024 02:20:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1runo0-0004CB-P1 for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2024 02:21:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Apr 2024 06:21:04 +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.171281646116073 (code B ref 58888); Thu, 11 Apr 2024 06:21:04 +0000 Original-Received: (at 58888) by debbugs.gnu.org; 11 Apr 2024 06:21:01 +0000 Original-Received: from localhost ([127.0.0.1]:54768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1runnw-0004Aw-74 for submit@debbugs.gnu.org; Thu, 11 Apr 2024 02:21:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1runnu-00049z-Io for 58888@debbugs.gnu.org; Thu, 11 Apr 2024 02:20:59 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1runne-0004Jn-T4; Thu, 11 Apr 2024 02:20:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KxiQJT/1rvO9JNuy+MTZk1Dx9nHymCHFYmeBojFN28s=; b=eIXy0JnFOdjS rA4ur93qey5rvtC4qugcitFPy8EgwWnzc5eBLmDQqpeDL76hgieNCaeozXo92LNSYxeuHqaf2f9Tj GVQDznZQ9DWsoq4lkOjxEoRKiKAd0JDV6lfuW4yZLxk5+RwnQUdB4xDwf14X++WwO5bB5Eqyg3xB/ pLnDdczgNR6TV5NY4NXaVKt4MMEMW+5brFWkxjDvyU3th5xAg1bp21vf4uxK8mHSG/inU6Vva1bgV FNjaSjZ+yowcb3MS16lnmPXxZA6FeuC2DFbTqvIoUA+Qgd4OufKZfvxuR6zV6ZJ1t2fJrgvbBoocU 1ev7QlhNhEyOG7kxIjivrg==; In-Reply-To: (bug-gnu-emacs@gnu.org) 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:283079 Archived-At: > Cc: 58888@debbugs.gnu.org > Date: Wed, 10 Apr 2024 16:34:48 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Eli, any objection to the patch below? Any idea how many major modes out there don't use run-mode-hooks? We are basically breaking those with this change, right? > Subject: [PATCH] (define-globalized-minor-mode): Require the use of > `run-mode-hooks` > > When `define-globalized-minor-mode` was introduced (Emacs-22), > `run-mode-hooks` was brand new, so we could not expect all major > modes to use it and we had to rely on brittle workarounds to try > and approximate `after-change-major-mode-hook`. > > These workarounds have undesirable side effects, and they're not > needed any more now that virtually all major modes have been > changed to use `run-mode-hooks`. > > * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): > Rely only on `after-change-major-mode-hook`. Fixes bug#58888. Please don't quote `like this`. (I think you should by now have a commit hook in your init files that replaces the quoting with our style, because this seems to be ubiquitous in all your writings.) > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1658,6 +1658,12 @@ documentation and examples. > > * Incompatible Lisp Changes in Emacs 30.1 > > +** 'define-globalized-minor-mode' requires that modes use 'run-mode-hooks'. > +Minor modes defined with 'define-globalized-minor-mode', such as > +'global-font-lock-mode', don't work any more with major modes which > +don't use 'run-mode-hooks'. Major modes defined with > +'define-derived-mode' are not affected. IMO, this NEWS entry is not detailed enough. First, it should mention that run-mode-hooks is the modern way of running the mode's hook, a replacement for run-hooks. And second, it should at least hint on what will happen with modes which don't use run-mode-hooks, so that affected users could identify the problem when they see its signs. Also, I think we should tell in the ELisp manual that run-mode-hooks is now a must, not just a preference, and we should mention in the Minor Modes chapter that the globalized minor modes will work correctly only if the major mode uses run-mode-hooks to run its hooks.