[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Should yaml-ts-mode inherit from prog-mode?
From: |
Yuri Khan |
Subject: |
Re: Should yaml-ts-mode inherit from prog-mode? |
Date: |
Tue, 21 Mar 2023 21:43:55 +0700 |
On Tue, 21 Mar 2023 at 21:14, Rudolf Schlatte <rudi@constantly.at> wrote:
> One meaningful behavior for `fill-paragraph' could be to allow it only
> within YAML flowed blocks and flow scalars (see
> https://yaml-multiline.info):
>
> script: |
> # this block cannot be refilled.
> apt-get -y update
> apt-get -y install my-necessary-package
This is reasonable behavior for literal-styled YAML blocks containing
a sequence of shell commands, or formatted code in a programming
language, or other line-break-sensitive content such as an embedded
YAML document. Swiping an example from [1]:
env1:
nova:
flavor: "30"
nics:
- net_id: db6e78cb-99fa-4223-9a6f-3b4a9b486d9b
userdata: |
#cloud-config
disable_root: False
ssh_pwauth: True
chpasswd:
list: |
root: password
[1]: https://medium.com/@george.shuklin/embedding-yaml-into-yaml-3511246d7ea7
On the other hand, for example, OpenAPI specifications accept Markdown
in several of its properties. My personal preference for these is to
notate them as literal-styled blocks so that joining lines into a
single paragraph happens in the Markdown processor.
In these cases, some users might want to ‘fill-paragraph’ Markdown
paragraphs inside a literal-styled YAML block.
description: |
Create a new foo
and return a 201 with `Location:` header set.
If the input data is invalid,
return a 400 with a detailed error report.
Without knowing the syntax for the YAML string value, there is not
enough information to allow or restrict ‘fill-paragraph’.
A sensible compromise could be to allow ‘fill-paragraph’ at user’s
discretion in all string literals, but recognize YAML’s string start
and end as paragraph boundaries.
- Re: Should yaml-ts-mode inherit from prog-mode?, (continued)
- Re: Should yaml-ts-mode inherit from prog-mode?, Richard Stallman, 2023/03/02
- Re: Should yaml-ts-mode inherit from prog-mode?, Romanos Skiadas, 2023/03/04
- Re: Should yaml-ts-mode inherit from prog-mode?, Randy Taylor, 2023/03/19
- Re: Should yaml-ts-mode inherit from prog-mode?, Eli Zaretskii, 2023/03/20
- Re: Should yaml-ts-mode inherit from prog-mode?, Rudolf Schlatte, 2023/03/20
- Re: Should yaml-ts-mode inherit from prog-mode?, Brian Cully, 2023/03/20
- Re: Should yaml-ts-mode inherit from prog-mode?, Eli Zaretskii, 2023/03/20
- Re: Should yaml-ts-mode inherit from prog-mode?, Jostein Kjønigsen, 2023/03/21
- Re: Should yaml-ts-mode inherit from prog-mode?, Eli Zaretskii, 2023/03/21
- Re: Should yaml-ts-mode inherit from prog-mode?, Rudolf Schlatte, 2023/03/21
- Re: Should yaml-ts-mode inherit from prog-mode?,
Yuri Khan <=
- Re: Should yaml-ts-mode inherit from prog-mode?, Rudolf Schlatte, 2023/03/21
- Re: Should yaml-ts-mode inherit from prog-mode?, Yuri Khan, 2023/03/22
- Re: Should yaml-ts-mode inherit from prog-mode?, David Ongaro, 2023/03/21
- Re: Should yaml-ts-mode inherit from prog-mode?, Randy Taylor, 2023/03/20
Re: Re: Should yaml-ts-mode inherit from prog-mode?, Pedro Andres Aranda Gutierrez, 2023/03/05
Re: Should yaml-ts-mode inherit from prog-mode?, Ongaro, 2023/03/11