From: Yuan Fu <casouri@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Phil Sainty <psainty@orcon.net.nz>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Calling another major mode in a major mode body
Date: Wed, 23 Nov 2022 10:36:22 -0800 [thread overview]
Message-ID: <3FDE8ADA-C67E-4047-816B-9259E8041ED2@gmail.com> (raw)
In-Reply-To: <jwv1qpumlrw.fsf-monnier+emacs@gnu.org>
> On Nov 22, 2022, at 6:46 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
>> Thanks for that detailed explanation :-)
>>
>> It seems the current mode’s after-hook is ran the very last. So it might be
>> a good place to call the fallback major mode. The call to run-hooks in
>> a major mode invocation command is outside the scope delay-mode-hooks, so
>> simply calling the fallback major mode should be fine?
>
> I think even cleaner is if the dispatch can happen before we even call
> `kill-all-local-variables`.
>
> That's what `tex-mode` does (tho it gets there in a roundabout way
> because I didn't want to change `define-derived-mode`).
>
>
> Stefan
>
Yes, it’s much cleaner. If we don’t care too much about using advice in our source. I’ll do that instead.
Yuan
next prev parent reply other threads:[~2022-11-23 18:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 22:07 Calling another major mode in a major mode body Yuan Fu
2022-11-22 0:44 ` Phil Sainty
2022-11-23 2:03 ` Yuan Fu
2022-11-23 2:15 ` Yuan Fu
2022-11-23 2:46 ` Stefan Monnier
2022-11-23 18:36 ` Yuan Fu [this message]
2022-11-23 19:21 ` Stefan Monnier
2022-12-04 7:54 ` Yuan Fu
2022-12-05 22:37 ` Richard Stallman
2022-12-05 22:50 ` Stefan Monnier
2022-12-08 23:07 ` Richard Stallman
2022-12-09 12:56 ` Stefan Monnier
2022-12-10 22:05 ` Richard Stallman
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=3FDE8ADA-C67E-4047-816B-9259E8041ED2@gmail.com \
--to=casouri@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=psainty@orcon.net.nz \
/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).