From: Yuan Fu <casouri@gmail.com>
To: Graham Marlow <graham@mgmarlow.com>
Cc: 68226@debbugs.gnu.org
Subject: bug#68226: [PATCH] Improve block_node handling for yaml-ts-mode fill-paragraph
Date: Tue, 2 Jan 2024 20:41:52 -0800 [thread overview]
Message-ID: <CCFB6865-11BF-46FD-8FC9-7A426054A72F@gmail.com> (raw)
In-Reply-To: <9d583305-9cdb-54bb-6e72-063b2c2a611e@mgmarlow.com>
> On Jan 2, 2024, at 2:10 PM, Graham Marlow <graham@mgmarlow.com> wrote:
>
> Hello Emacs maintainers,
>
> I noticed that the yaml-ts-mode fill-paragraph function doesn't play nicely with block nodes, making it difficult to tidy paragraphs. For example,
>
> foo: |
> line-one
> line-two
>
> Becomes
>
> foo: | line-one line-two
>
> Effectively undoing the block.
>
> My proposed changes (see attached patch) fixes this behavior so that block nodes remain formatted correctly:
>
> foo: |
> line-one line-two
>
> It also plays nicely with longer pieces of text and multiple paragraphs.
>
> I tried to base my changes off of the fill-paragraph function from c-ts-common, though the YAML version is much simpler since it doesn't need to account for comment insertion. I've not written a fill-paragraph function before so I'm sure I messed something up.
>
> What do you think?<0001-Improve-block_node-handling-for-yaml-ts-mode-fill-pa.patch>
Thank you! This is great. The function assumes that the block starts at the line below “|”, but I think it’s very rare when people write string block right after the “|”.
Have you signed the copyright assignment?
Yuan
next prev parent reply other threads:[~2024-01-03 4:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-02 22:10 bug#68226: [PATCH] Improve block_node handling for yaml-ts-mode fill-paragraph Graham Marlow
2024-01-03 4:41 ` Yuan Fu [this message]
2024-01-03 5:21 ` Graham Marlow
2024-01-05 0:42 ` Yuan Fu
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CCFB6865-11BF-46FD-8FC9-7A426054A72F@gmail.com \
--to=casouri@gmail.com \
--cc=68226@debbugs.gnu.org \
--cc=graham@mgmarlow.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.