emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should yaml-ts-mode inherit from prog-mode?


From: Philip Kaludercic
Subject: Re: Should yaml-ts-mode inherit from prog-mode?
Date: Thu, 02 Mar 2023 13:44:10 +0000

Vasilij Schneidermann <mail@vasilij.de> writes:

> More generally speaking, maybe the whole idea of having a hierarchy of
> major modes needs to be rethought. It is difficult to get such a
> hierarchy right, especially when there are multiple ways to categorize a
> major mode.

Deriving from prog-mode or from text-mode doesn't mean much in practice.
I see it as less of a formal taxonomy of programming languages, and more
of a convenience measure to make changes that (vaguely speaking) "all
programming modes" or "all text-related modes" have in common.  E.g. I
have this in my init.el:

  (add-hook 'text-mode-hook #'flyspell-mode)
  (add-hook 'prog-mode-hook #'flyspell-prog-mode)

and I asked myself would I prefer yaml-mode to use the former or the
latter mode, I'd say that `flyspell-prog-mode' were a better fit.

Of course if neither makes sense or it is too inconsistent, there is no
reason YAML modes would have to inherit from either.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]