[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Extending define-derived-mode
From: |
Juri Linkov |
Subject: |
Re: Extending define-derived-mode |
Date: |
Tue, 30 May 2023 20:24:35 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) |
> I don’t have a clear vision right now, perhaps we want
> multiple inheritance for hooks, perhaps we can simply allow
> define-derived-mode to specify additional hooks to run, and create
> some language hooks that are shared by every mode serving that language.
> I’d like to hear your thoughts.
A well-known alternative to multiple inheritance would be to use mixins.
Implementation-wise this means extracting common parts to separate functions,
then calling e.g. 'js-base-setup' from both 'js-mode' and 'js-ts-mode'.