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: Eli Zaretskii
Subject: Re: Should yaml-ts-mode inherit from prog-mode?
Date: Mon, 20 Mar 2023 18:53:20 +0200

> From: Rudolf Schlatte <rudi@constantly.at>
> Date: Mon, 20 Mar 2023 15:37:05 +0100
> 
> Let me try one last argument for making the switch to prog-mode.  Put
> the following yaml fragment into a file and hit M-q ("fill-paragraph").
> This destroys the yaml structure:
> 
> Before fill-paragraph:
> 
>     jobs:
>       check:
>         runs-on: ubuntu-latest
>         strategy:
>           fail-fast: false
>           matrix:
>             emacs_version:
>               - 27.1
>               - 27.2
>               - 28.1
>               - 28.2
> 
> After fill-paragraph:
> 
>     jobs: check: runs-on: ubuntu-latest strategy: fail-fast: false matrix:
>       emacs_version: - 27.1 - 27.2 - 28.1 - 28.2

This just means that yaml-ts-mode should be fixed by defining an
appropriate fill-paragraph-function.  Many descendants of prog-mode
define such functions, so being a descendant of prog-mode doesn't
magically make M-q DTRT for a mode.

> I'd argue that many commands offered by text-mode would have to be
> audited or adapted to be meaningful in a yaml file; for example, what is
> `forward-sentence' supposed to do in the context of yaml?

What useful things does forward-sentence do in C mode or in Emacs Lisp
mode?

Anyway, this and other similar arguments were already brought up, I
believe.  And other arguments were brought up in defense of the
opposite view.  Which is why I think there's no strong justification
to make yaml-ts-mode a descendant of prog-mode, after we had it where
it is now for some time.



reply via email to

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