From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#35351: 27.0.50; Enable derived modes to run their own very-early 'change-major-mode-hook' code Date: Mon, 22 Apr 2019 10:39:24 -0400 Message-ID: References: <85237c18-768d-089b-221a-fe70b0ba4379@orcon.net.nz> <7db75b50-1925-8c1e-acc5-c393b701e6a3@orcon.net.nz> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="163666"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35351@debbugs.gnu.org To: Phil Sainty Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 22 16:40:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIa7A-000gSi-GO for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Apr 2019 16:40:12 +0200 Original-Received: from localhost ([127.0.0.1]:38220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIa79-0004Dj-D2 for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Apr 2019 10:40:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIa71-0004DX-JR for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 10:40:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIa70-0000rQ-Fa for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 10:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37671) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIa70-0000rJ-CI for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 10:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIa70-0000cg-6s for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 10:40:02 -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, 22 Apr 2019 14:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35351 X-GNU-PR-Package: emacs Original-Received: via spool by 35351-submit@debbugs.gnu.org id=B35351.15559439732347 (code B ref 35351); Mon, 22 Apr 2019 14:40:02 +0000 Original-Received: (at 35351) by debbugs.gnu.org; 22 Apr 2019 14:39:33 +0000 Original-Received: from localhost ([127.0.0.1]:51215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIa6W-0000bm-LV for submit@debbugs.gnu.org; Mon, 22 Apr 2019 10:39:32 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:57752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIa6R-0000bb-MW for 35351@debbugs.gnu.org; Mon, 22 Apr 2019 10:39:31 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id x3MEdPFb019153; Mon, 22 Apr 2019 10:39:25 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id ED7EF6619A; Mon, 22 Apr 2019 10:39:24 -0400 (EDT) In-Reply-To: <7db75b50-1925-8c1e-acc5-c393b701e6a3@orcon.net.nz> (Phil Sainty's message of "Mon, 22 Apr 2019 20:16:33 +1200") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6530=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6530> : inlines <7058> : streams <1819406> : uri <2835737> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158043 Archived-At: > Yes, I think I like that least of all -- having the macro set up > everything based on a different name to the mode that people are > expected to be using just seems wrong to me. I tend to view this as the fact that those "modes" should distinguish between the mode and the command that invokes it, because that command does more than setup the mode (e.g. it arranges to be able to go back to the earlier modes). E.g. in your case the mode could be called `so-long-mode` and the command to enter it could be `so-long`. > I'm now unsure whether :after-hook was intended to be interpreted > as "this is a bit like a *hook* which runs *after* everything > else has happened"; or if it meant "do this thing *after* the > mode *hook*" (or indeed after after-change-major-mode-hook). Oh, you're absolutely right, it's called ":after-hook" because it runs after the mode-hook. > In the initial commit I've used an approach which will run the > parent's :before-hook That seems backward to me. > Possibly it should be child-before-parent on the basis that the > author then has more influence over the order in which things > happen? Exactly. Stefan