From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#70671: 30.0.50; mhtml-mode ignores delay-mode-hooks Date: Fri, 03 May 2024 07:48:29 +0000 Message-ID: <87zft78hf6.fsf@localhost> References: <87bk5r6kz9.fsf@localhost> <86ttjglexh.fsf@gnu.org> 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="13628"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 70671@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 03 09:47:59 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 1s2neB-0003JP-6e for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 May 2024 09:47:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2ndt-0000rg-Ex; Fri, 03 May 2024 03:47:41 -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 1s2nds-0000rS-Dx for bug-gnu-emacs@gnu.org; Fri, 03 May 2024 03:47:40 -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 1s2nds-0005l4-5Y for bug-gnu-emacs@gnu.org; Fri, 03 May 2024 03:47:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s2neE-0003RI-D6 for bug-gnu-emacs@gnu.org; Fri, 03 May 2024 03:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 May 2024 07:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70671 X-GNU-PR-Package: emacs Original-Received: via spool by 70671-submit@debbugs.gnu.org id=B70671.171472247713212 (code B ref 70671); Fri, 03 May 2024 07:48:02 +0000 Original-Received: (at 70671) by debbugs.gnu.org; 3 May 2024 07:47:57 +0000 Original-Received: from localhost ([127.0.0.1]:46230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2ne8-0003R2-JY for submit@debbugs.gnu.org; Fri, 03 May 2024 03:47:56 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:50071) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2ne3-0003Qw-Qe for 70671@debbugs.gnu.org; Fri, 03 May 2024 03:47:55 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9BBEC240029 for <70671@debbugs.gnu.org>; Fri, 3 May 2024 09:47:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714722443; bh=gaTvMrMrcbsfkO5KBIk7TI6mphX/9I42Em//azKttw0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=Fj4HBJVs3N3k1l7smrP0mcFtUWhrof4ttG/EPS85YSkt+BtOVuD/ny7KYJv8u5dpA 6Tyn4CdEJXNBHiDGzOBbCP5HBIRvrfd8/Nz46YI2698Lj7odC3HffVaeUpzXpPH3l8 sPozp/nnzA2PPT57HVO7JTnJ2lcUXcWacVXfj3v3A6qk9WS9jgEwDnvcIUNwQhWWbt bjPGhQa5WOMT+E0jFcQxj24/UVA34GBpAIUSgca7n9IdEWpDL2kgZs98keC9Lp3Erv gPwEc2yuBTPehKRLOhTLzaHUgIOeqIcPxG4f2GC3ZIdyLR43l7MTN6llHJArm6Ul8h aJIA+oGA+vL0Q== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VW2vZ1KKcz9rxD; Fri, 3 May 2024 09:47:21 +0200 (CEST) In-Reply-To: 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:284371 Archived-At: --=-=-= Content-Type: text/plain Stefan Monnier writes: >>> May mhtml-mode be changed to use (run-mode-hooks 'prog-mode-hook) >>> instead, so that `delay-mode-hooks' is honoured? >> ... >> Stefan, WDYT? > > It should use `run-mode-hooks`, indeed, thanks, See the attached patch. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-mhtml-mode-Use-run-mode-hook-to-run-prog-mode-hook-b.patch >From a73131234019d51b93cf6422fc86218d962167d4 Mon Sep 17 00:00:00 2001 Message-ID: From: Ihor Radchenko Date: Fri, 3 May 2024 10:46:22 +0300 Subject: [PATCH] mhtml-mode: Use `run-mode-hook' to run `prog-mode-hook' (bug#70671) * lisp/textmodes/mhtml-mode.el (mhtml-mode): When running hooks simulating inheritance from `prog-mode', use `run-mode-hooks' that honors `delay-mode-hooks' macro. Note that `delay-mode-hooks' is bound to non-nil when major mode body is evaluated, so there is no chance that any major mode-related hooks are executed twice. --- lisp/textmodes/mhtml-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/mhtml-mode.el b/lisp/textmodes/mhtml-mode.el index 0b5c6756ab9..e2de6959dc6 100644 --- a/lisp/textmodes/mhtml-mode.el +++ b/lisp/textmodes/mhtml-mode.el @@ -359,7 +359,7 @@ mhtml-mode (add-hook 'before-change-functions #'c-foreign-truncate-lit-pos-cache nil t) ;; This is sort of a prog-mode as well as a text mode. - (run-hooks 'prog-mode-hook)) + (run-mode-hooks 'prog-mode-hook)) (put 'mhtml-mode 'flyspell-mode-predicate #'mhtml--flyspell-check-word) -- 2.44.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--