unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Rudolf Schlatte <rudi@constantly.at>
Cc: emacs-devel@gnu.org
Subject: Re: Should yaml-ts-mode inherit from prog-mode?
Date: Tue, 21 Mar 2023 21:43:55 +0700	[thread overview]
Message-ID: <CAP_d_8VVW2B+WJ2sWsLCTnV6Z7xfarubPr4q8LNfYwhXrjZMVA@mail.gmail.com> (raw)
In-Reply-To: <m2bkkm2ose.fsf@eduroam-193-157-164-7.wlan.uio.no>

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.



  reply	other threads:[~2023-03-21 14:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 19:07 Should yaml-ts-mode inherit from prog-mode? Romanos Skiadas
2023-03-03  4:23 ` Richard Stallman
2023-03-04 18:24   ` Romanos Skiadas
2023-03-20  1:52     ` Randy Taylor
2023-03-20 12:07       ` Eli Zaretskii
2023-03-20 14:37         ` Rudolf Schlatte
2023-03-20 16:20           ` Brian Cully via Emacs development discussions.
2023-03-20 16:53           ` Eli Zaretskii
2023-03-21 11:19           ` Jostein Kjønigsen
2023-03-21 13:26             ` Eli Zaretskii
2023-03-21 13:54               ` Rudolf Schlatte
2023-03-21 14:43                 ` Yuri Khan [this message]
2023-03-21 15:03                   ` Rudolf Schlatte
2023-03-22  6:04                     ` Yuri Khan
2023-03-22  2:37           ` David Ongaro
2023-03-21  3:13         ` Randy Taylor
  -- strict thread matches above, loose matches on Subject: below --
2023-02-28 12:24 Romanos Skiadas
2023-02-28 15:52 ` Basil Contovounesios
2023-03-01 14:08   ` Randy Taylor
2023-03-01 14:28     ` Lynn Winebarger
2023-03-01 16:35     ` Vasilij Schneidermann
2023-03-02 12:55       ` Lynn Winebarger
2023-03-02 13:44       ` Philip Kaludercic
2023-03-03  9:00         ` Rudolf Schlatte
2023-03-03 21:58           ` Yuan Fu
2023-03-04 18:45             ` Juri Linkov
2023-02-28 17:50 ` Daniel Fleischer
2023-02-28 17:56 ` Daniel Fleischer
2023-02-28 18:33   ` Dmitry Gutov
2023-03-01 13:35     ` Basil Contovounesios
2023-03-12  2:14   ` Ongaro
2023-03-12  9:20     ` Daniel Fleischer
2023-03-12 12:31       ` Rudolf Schlatte
2023-03-13  8:44       ` Yuri Khan
2023-03-14  1:45       ` David Ongaro
2023-03-01  7:46 ` Matthias Meulien
2023-03-01 13:45   ` Basil Contovounesios
2023-03-07 11:27     ` Jostein Kjønigsen
2023-03-07 14:28       ` Matthias Meulien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP_d_8VVW2B+WJ2sWsLCTnV6Z7xfarubPr4q8LNfYwhXrjZMVA@mail.gmail.com \
    --to=yuri.v.khan@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=rudi@constantly.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).