unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 35351@debbugs.gnu.org
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	[thread overview]
Message-ID: <1c020e77-3a71-4b84-c15d-752062b8b8db@orcon.net.nz> (raw)
In-Reply-To: <jwvsgu9pj9f.fsf-monnier+emacs@gnu.org>

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





  reply	other threads:[~2019-04-23  3:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-21  2:35 bug#35351: 27.0.50; Enable derived modes to run their own very-early 'change-major-mode-hook' code Phil Sainty
2019-04-21  2:45 ` Phil Sainty
2019-04-21  6:01   ` Richard Stallman
2019-04-21 20:54 ` Stefan Monnier
2019-04-22  8:16   ` Phil Sainty
2019-04-22 14:39     ` Stefan Monnier
2019-04-22 23:18       ` Phil Sainty
2019-04-22 23:31         ` Phil Sainty
2019-04-23  2:08         ` Stefan Monnier
2019-04-23  3:52           ` Phil Sainty [this message]
2019-04-23 11:59             ` Stefan Monnier
2019-04-22 14:41     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c020e77-3a71-4b84-c15d-752062b8b8db@orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=35351@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).