GNU bug report logs - #76701
31.0.50; recent regression in [global] font-lock-mode?

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Madhu <enometh@HIDDEN>; dated Mon, 3 Mar 2025 03:16:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Mar 2025 12:24:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 04 07:24:43 2025
Received: from localhost ([127.0.0.1]:56053 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tpRKE-00052F-UI
	for submit <at> debbugs.gnu.org; Tue, 04 Mar 2025 07:24:43 -0500
Received: from lists.gnu.org ([2001:470:142::17]:32776)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1tpRKC-00051w-Cz
 for submit <at> debbugs.gnu.org; Tue, 04 Mar 2025 07:24:40 -0500
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 <geb-bug-gnu-emacs@HIDDEN>)
 id 1tpRK6-0000N7-Kb
 for bug-gnu-emacs@HIDDEN; Tue, 04 Mar 2025 07:24:34 -0500
Received: from ciao.gmane.io ([116.202.254.214])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1tpRK4-0000FK-Tp
 for bug-gnu-emacs@HIDDEN; Tue, 04 Mar 2025 07:24:34 -0500
Received: from list by ciao.gmane.io with local (Exim 4.92)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1tpRK2-000AFC-4a
 for bug-gnu-emacs@HIDDEN; Tue, 04 Mar 2025 13:24:30 +0100
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Madhu <enometh@HIDDEN>
Subject: Re: bug#76701: 31.0.50; recent regression in [global] font-lock-mode?
Date: Tue, 04 Mar 2025 17:54:43 +0530
Message-ID: <m3cyexq8z8.fsf@HIDDEN>
References: <20250303.084505.63079830859903383.enometh@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
Cancel-Lock: sha1:sFALo+RJ1svqPt5R7f+dACFOeB0=
Received-SPF: pass client-ip=116.202.254.214;
 envelope-from=geb-bug-gnu-emacs@HIDDEN; helo=ciao.gmane.io
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9,
 HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


This bug report can be closed without being opened.

The question has been answered in
https://lists.gnu.org/archive/html/help-gnu-emacs/2025-03/msg00050.html

        "The commit changes the macro-expansion of
	`define-globalized-minor-mode`, so it will only manifest after
	you recompile the file that uses `define-globalized-minor-mode`
	to define the minor mode."

and subthreads.

This is in reference to the commit 17e26cf57e1 2024-04-13 20:01:28
"(define-globalized-minor-mode): Require the use of `run-mode-hooks`"

[the effects didn't show up in incremental builds until this year,
when it took effect probably after the copyright updates.]





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76701; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Mar 2025 03:15:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 02 22:15:10 2025
Received: from localhost ([127.0.0.1]:41521 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1towGq-0005hU-Mk
	for submit <at> debbugs.gnu.org; Sun, 02 Mar 2025 22:15:09 -0500
Received: from lists.gnu.org ([2001:470:142::17]:60314)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <enometh@HIDDEN>) id 1towGn-0005eE-Fe
 for submit <at> debbugs.gnu.org; Sun, 02 Mar 2025 22:15:06 -0500
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 <enometh@HIDDEN>) id 1towGh-0005hk-RL
 for bug-gnu-emacs@HIDDEN; Sun, 02 Mar 2025 22:14:59 -0500
Received: from smtp5.ctinetworks.com ([205.166.61.198])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <enometh@HIDDEN>) id 1towGg-0002js-4c
 for bug-gnu-emacs@HIDDEN; Sun, 02 Mar 2025 22:14:59 -0500
X-ctinetworks-Watermark: 1741835696.50422@sLPWTp6mCt9gj2Nvt8VcIA
X-ctinetworks-Envelope-From: enometh@HIDDEN
X-ctinetworks-SpamCheck: 
X-ctinetworks-VirusCheck: Found to be clean
X-ctinetworks-Message-ID: 740E02064EED.A2378
Received: from localhost (unknown [117.254.37.115])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits))
 (No client certificate requested)
 (Authenticated sender: enometh@HIDDEN)
 by smtp5.ctinetworks.com (Postfix) with ESMTPSA id 740E02064EED
 for <bug-gnu-emacs@HIDDEN>; Sun,  2 Mar 2025 22:14:54 -0500 (EST)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp5.ctinetworks.com 740E02064EED
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meer.net;
 s=ctidkims1; t=1740971695;
 bh=SgIinGkHyqWbfofsA8tIVZhGVehe2ph1jN2RQewPnG8=;
 h=Date:To:Subject:From:From;
 b=imSoGUdv2uYnmRP3Pkezydx/KypYqaprCZnnsAruXkMNE79WJ0/CbDUct9rosOeaR
 /Mv/iyDLlZhe/4h74qOy2owfnmdrebTnCpW31ERjtOkyYeecMViixiDLQ5uD3KsB1Y
 KLmi/r9PC6uh8MEgdw9MViaZeOK5kYaQ9tbPZA/E=
Date: Mon, 03 Mar 2025 08:45:05 +0530 (IST)
Message-Id: <20250303.084505.63079830859903383.enometh@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; recent regression in [global] font-lock-mode?
From: Madhu <enometh@HIDDEN>
X-Mailer: Mew version 6.9 on Emacs 31.0.50
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Mon_Mar__3_08_45_05_2025_030)--"
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=205.166.61.198; envelope-from=enometh@HIDDEN;
 helo=smtp5.ctinetworks.com
X-Spam_score_int: 12
X-Spam_score: 1.2
X-Spam_bar: +
X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_SBL_CSS=3.335,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 4.5 (++++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: [I posted a query
 https://lists.gnu.org/archive/html/help-gnu-emacs/2025-03/msg00005.html
 on help-gnu-emacs but the discussion didn't proceed, so I'm reposting here]
 Attached is a test case named `debug-font-lock-foo-spec-mode.el' which sets
 up a minor-mode foo-spec-mode for *.foospec files which highlights the string
 "FOO-SPEC" with font-lock-warning-space. 
 Content analysis details:   (4.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.9 SPF_FAIL               SPF: sender does not match SPF record (fail)
 [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;
 id=enometh%40meer.net; ip=2001%3A470%3A142%3A%3A17; r=debbugs.gnu.org]
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [117.254.37.115 listed in zen.spamhaus.org]
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [I posted a query https://lists.gnu.org/archive/html/help-gnu-emacs/2025-03/msg00005.html
    on help-gnu-emacs but the discussion didn't proceed, so I'm reposting here]
    Attached is a test case named `debug-font-lock-foo-spec-mode.el' which sets
    up a minor-mode foo-spec-mode for *.foospec files which highlights the string
    "FOO-SPEC" with font-lock-warning-space. 
 
 Content analysis details:   (3.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2001:470:142:0:0:0:0:17 listed in]
                             [list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [117.254.37.115 listed in zen.spamhaus.org]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
  0.9 SPF_FAIL               SPF: sender does not match SPF record (fail)
 [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;id=enometh%40meer.net;ip=2001%3A470%3A142%3A%3A17;r=debbugs.gnu.org]
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

----Next_Part(Mon_Mar__3_08_45_05_2025_030)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

[I posted a query
https://lists.gnu.org/archive/html/help-gnu-emacs/2025-03/msg00005.html
on help-gnu-emacs but the discussion didn't proceed, so I'm reposting
here]

Attached is a test case named `debug-font-lock-foo-spec-mode.el' which
sets up a minor-mode foo-spec-mode for *.foospec files which
highlights the string "FOO-SPEC" with font-lock-warning-space.

On invoking the following sequence
```
echo FOO-SPEC > /tmp/foo.foospec
emacs -Q -l debug-font-lock-foo-spec-mode.el /tmp/foo.foospec
```

I expect to open "/tmp/foo.foospec" in a buffer and have it fontified
in red.  However the buffer ends up with font-lock-mode: nil even
though global-font-lock-mode is t (under emacs -Q).

I think this used to work until recently. Is this a possible
regression or is the testcase flawed because of some recent changes?
--Best Regards, Madhu


----Next_Part(Mon_Mar__3_08_45_05_2025_030)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="debug-font-lock-foo-spec-mode.el"


(defvar foo-spec-mode-font-lock-keywords
  (list
   (cons "^FOO-SPEC$"  '(0 font-lock-warning-face))))

(defun foo-spec-mode ()
  (interactive)
  (kill-all-local-variables)
  (setq major-mode 'foo-spec-mode)
  (setq mode-name "FooSpec")
  (setq-local font-lock-defaults '(foo-spec-mode-font-lock-keywords nil t))
  (run-hooks 'foo-spec-mode-hook))

(add-to-list 'auto-mode-alist '("\\.foospec$" . foo-spec-mode))

----Next_Part(Mon_Mar__3_08_45_05_2025_030)----




Acknowledgement sent to Madhu <enometh@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#76701; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 4 Mar 2025 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.