On Wed, Jan 17, 2024 at 2:41 AM Dmitry Gutov <dmitry@gutov.dev> wrote:
An "abstract" mode is supposedly one that doesn't do anything. So it
doesn't have to be callable.
No. Not "abstract" as in "Java interface", abstract as in "Java
abstract class".
Anyway, that's +1 feature required for the implementation.
Almost trivial feature. See patch after sig. It'll make this work:
(define-derived-mode foo-mode prog-mode "Fooey" :abstract t
(message "Hey from foo-mode"))
(define-derived-mode bar-mode foo-mode "Barey"
(message "Hey from bar-mode"))
'foo-mode' can't be called, but 'bar-mode can, of course. And it
will call its parent.
What if we filter by prog-mode? It would leave the ':ruby-base' and
':python-base' as false positives, I guess. But then we could reasonably
say that anything ending with '-base' is abstract (or use the
aforementioned explicit abstract prop).
We would also filter out :css, for example.
Sure? I see a super-normal css-base-mode inheriting from
prog-mode.
TeX modes also do not derive
from prog-mode. TeX does have an LSP server, however.
At the end of the day we have to come to a conclusion of what
we want to do. I want to find major modes that correspond
to languages, right? So:
* these outliers start inheriting from prog-mode
* we inject new lang-mode between prog-mode and fundamental-mode and make
outliers derive from that.
* we say these outliers aren't languages
* we code exceptions for these outliers
It could even be that
(derived-mode-add-parents 'tex-mode '(prog-mode))
is exactly what's needed here, showcasing how I think this
particular heavy hammer should be used for the exception, not
the rule.