Subject: bug#35351: 27.0.50; Enable derived modes to run their own very-early 'change-major-mode-hook' code

From: Phil Sainty <[email-masked]>
Date: Tue, 23 Apr 2019 15:52:18 +1200

On 23/04/19 2:08 PM, Stefan Monnier wrote:
>>> Oh, you're absolutely right, it's called ":after-hook" because it
>>> runs after the mode-hook.
>> Which means :before-hook definitely isn't a good name for the new
>> keyword.
> 
> It's run before the before-change-mode-hook, so the name isn't
> completely wrong (and the description of :before-hook makes this
> connection clear).
> 
>> Should I go with :eval-before ?
> 
> I'd prefer we avoid "eval" since that would suggest to quote the form.
> IOW, I think `:before-hook` is fine.

Point taken re: eval (although at minimum we have `with-eval-after-load'
which does not require quoting), but I'm also not terribly happy with
"before-hook", as I now feel it's quite ambiguous.

Running a derived mode involves all of the following hooks:

* change-major-mode-hook
* change-major-mode-after-body-hook
* *-mode-hook(s)
* after-change-major-mode-hook
* delayed-after-hook-functions

So "before hook" (and "after hook") are pretty vague.  Especially when
the "hook" in question is different in each case.

The documentation would indeed clarify, but I think it's sensible to
choose a name which gives a clearer idea from the outset.

My other suggestion of :before-change still seems reasonable to me.

-Phil