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

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Sun, 21 Apr 2019 02:41:01 UTC

Severity: wishlist

Found in version 27.0.50

Full log


Message #35 received at 35351 <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 35351 <at> debbugs.gnu.org
Subject: Re: 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
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




This bug report was last modified 6 years and 54 days ago.

Previous Next


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