[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Calling another major mode in a major mode body
From: |
Yuan Fu |
Subject: |
Re: Calling another major mode in a major mode body |
Date: |
Wed, 23 Nov 2022 10:36:22 -0800 |
> 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