GNU bug report logs - #68781
[PATCH] Don't fill yaml except comments and block scalars.

Previous Next

Package: emacs;

Reported by: Rudolf Schlatte <rudi <at> constantly.at>

Date: Sun, 28 Jan 2024 13:17:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#68781: closed ([PATCH] Don't fill yaml except comments and
 block scalars.)
Date: Thu, 01 Feb 2024 10:32:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 01 Feb 2024 12:31:30 +0200
with message-id <86r0hwzda5.fsf <at> gnu.org>
and subject line Re: bug#68781: [PATCH] Don't fill yaml except comments and block scalars.
has caused the debbugs.gnu.org bug report #68781,
regarding [PATCH] Don't fill yaml except comments and block scalars.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
68781: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68781
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Rudolf Schlatte <rudi <at> constantly.at>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Don't fill yaml except comments and block scalars.
Date: Sun, 28 Jan 2024 14:15:58 +0100
[Message part 3 (text/plain, inline)]
Tags: patch

Hi,

Currently, yaml-ts-mode fills comments and block scalars (multi-line
text literals) as expected, but re-fills the whole file when point is
outside of either of these constructs.  Since yaml line breaks and
whitespace are significant, I'd say that this is never the correct
behavior.

This patch against current master inhibits M-q (fill-paragraph) outside
of comments and block scalars.  In my tests default fill-paragraph
worked as expected both with and without justify, correctly detecting
comment and block literal boundaries, so I did not preserve the previous
code in `yaml-ts-mode--fill-paragraph'.

[0001-Don-t-fill-yaml-except-comments-and-block-scalars.patch (text/patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Randy Taylor <dev <at> rjt.dev>
Cc: 68781-done <at> debbugs.gnu.org, rudi <at> constantly.at, graham <at> mgmarlow.com
Subject: Re: bug#68781: [PATCH] Don't fill yaml except comments and block
 scalars.
Date: Thu, 01 Feb 2024 12:31:30 +0200
> Cc: Rudolf Schlatte <rudi <at> constantly.at>, 68781 <at> debbugs.gnu.org
> Date: Tue, 30 Jan 2024 19:25:07 +0000
> From: Randy Taylor <dev <at> rjt.dev>
> 
> On Monday, January 29th, 2024 at 20:20, Graham Marlow <graham <at> mgmarlow.com> wrote:
> > 
> > 
> > > Hello Randy, thanks for having a look! Could you tell me which
> > 
> > > tree-sitter grammar you are using? I'm asking because with the grammar
> > > from https://github.com/ikatyang/tree-sitter-yaml I don't see what you
> > > describe.
> > 
> > 
> > For the record I'm also using this grammar.
> > 
> > Looking at the patch, what do you think about retaining the existing
> > behavior (so block_scalars still fill correctly) while inhibiting
> > fill_paragraph for everything else as suggested? Originally I retained
> > the existing behavior of fill-paragraph just to limit the number of
> > things changed by the patch, not because it was working properly. I
> > think blocking the call to fill-paragraph for non-block/comment nodes
> > makes sense.
> > 
> > I attached a patch w/ my edits, but it just swaps the when to and if,
> > accepts the comment node type for filling, and returns t to avoid
> > calling fill-paragraph for other nodes.
> 
> Thanks Graham, the patch looks good to me.
> 
> Would someone please install it on master? Thanks in advance.

Thanks, done, and closing the bug.


This bug report was last modified 1 year and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.