>>>>> d. Directory local variables >> Maybe the simplest option is to get used to the idea of setting >> `derived-mode-parent` manually for those modes which are "morally" >> a child mode, even though the implementation (and behavior) does not >> inherit much if anything? > > Do you mean > (put 'LaTeX-mode 'derived-mode-parent 'latex-mode) > ? In that case, `LaTeX-mode' can't have AUCTeX common TeX mode (in my > personal plan, `TeX-VirTeX-mode') as its parent.
Ah, right, that won't work. > Is there any way to assign multiple parent modes to `LaTeX-mode'? Not currently, no. Allowing `define-derived-mode` to inherit from multiple modes is technically difficult, but extending `provided-mode-derived-p` to support multiple parents should be fairly easy, so maybe we should do that. > [From your post to bug#61211] >> I'm also thinking that maybe `set-auto-mode` should remember the name >> of the "mode function" it called so we could consult this (in addition >> to the value of `major-mode`) when applying directory-local vars? > If that is possible, it will be a good solution. I already save some "old mode" info in `set-auto-mode--last` (for the purpose of `major-mode-remap-alist`), so maybe all it takes is to use it in the code handling directory-local variables? It does run the risk of setting vars for an unrelated mode, but maybe it's OK (or maybe it needs to use the "old mode" only when the real mode has no directory-local vars set or something like that)? Stefan