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: Matthias Meulien
Subject: Re: Should yaml-ts-mode inherit from prog-mode?
Date: Wed, 1 Mar 2023 08:46:26 +0100

YAML is a data serialization format. Like JSON.

As a user of ELPA's yaml-mode, I was surprised too it isn't coherent with lisp-data-mode, js-json-mode, json-ts-mode who all inherit from prog-mode. And I had to disable the input method I usually enable in text mode buffers, re-enable flymake and my shortcut for flymake-show-diagnostics-buffer...

Since yaml-ts-mode is new it'd be a good thing to be coherent.

But thinking twice is there any concrete gains of inheriting from prog-mode rather than text-mode for the end-user?
Don't we already face that dilemna with nxml since XML is used to serialize data?


Le mar. 28 févr. 2023 à 15:14, Romanos Skiadas <rom.skiad@gmail.com> a écrit :
Hello,

I was using yaml-ts-mode in Emacs 30, and to my surprise I found it inherits from text-mode.

Now, a case can be made for that for sure. The existing rather widely used mode uses text-mode, although that seems like an arbitrary decision by a single maintainer:
https://github.com/yoshiki/yaml-mode/issues/17
https://github.com/yoshiki/yaml-mode/issues/27
https://github.com/yoshiki/yaml-mode/issues/52
https://github.com/yoshiki/yaml-mode/pull/85

(I'm not sure Emacs maintainers are beholden to a decision made some jumps away and whether this is a strong enough argument to keep yaml-ts-mode as is.)

However, and here is where things kind of break down a bit: I would personally argue that YAML has a code feel to it, what with all the bash scripts that end up in it. Personally, I feel that YAML is more of a prog language than JSON (whatever that means), and according to the spec it is a superset of JSON. In fact, the JSON mode shipped with Emacs inherits from prog-mode!

So, what do people think? Should yaml-ts-mode be changed?

Best,
rski





--
Matthias

reply via email to

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