[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#35351: 27.0.50; Enable derived modes to run their own very-early 'ch

From: Phil Sainty
Subject: bug#35351: 27.0.50; Enable derived modes to run their own very-early 'change-major-mode-hook' code
Date: Tue, 23 Apr 2019 15:52:18 +1200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]