From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Randy Taylor Newsgroups: gmane.emacs.bugs Subject: bug#68781: [PATCH] Don't fill yaml except comments and block scalars. Date: Mon, 29 Jan 2024 03:47:53 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10422"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "graham@mgmarlow.com" , 68781@debbugs.gnu.org To: Rudolf Schlatte Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 29 04:49:16 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rUIe4-0002VM-2G for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Jan 2024 04:49:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUIdk-0008Q0-DN; Sun, 28 Jan 2024 22:48:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUIdi-0008Pd-KO for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 22:48:55 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUIdi-0001mq-C1 for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 22:48:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUIdq-0004O1-01 for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 22:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Jan 2024 03:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68781 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68781-submit@debbugs.gnu.org id=B68781.170650011216711 (code B ref 68781); Mon, 29 Jan 2024 03:49:01 +0000 Original-Received: (at 68781) by debbugs.gnu.org; 29 Jan 2024 03:48:32 +0000 Original-Received: from localhost ([127.0.0.1]:58743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUIdM-0004LR-0G for submit@debbugs.gnu.org; Sun, 28 Jan 2024 22:48:32 -0500 Original-Received: from mail-4323.proton.ch ([185.70.43.23]:36605) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUIdE-0004Js-1R for 68781@debbugs.gnu.org; Sun, 28 Jan 2024 22:48:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail; t=1706500088; x=1706759288; bh=bPwE6U4TL3Q6Zdt8J5pzfteYhsine9ZVrierTzJvelE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=H5YWya4uEQ6vpaS55+5Q+lcP7kQXFv3OrWIyiZISjDeUHoXS6Xm2fF/M1G0+JGb51 dnfREhMJAPXZY0bDrCp8r3dHMyo7oirzVGoR/NUJG2w+GKehlskguwbisfEmmU0pdA zu5MNvk6hZZfWiBS4g7kAQs5aBap0U0332jGDgeZllNyWB5UNHzUYS2O79bnJ1Xv1O OsWZSEvcGDmGPnythvatpEzgE4iBMpy8pDPmkVgiGaFP2M+mI9OOCmcKCK/MaYXigk ew4SZT79RJM6Mswhd1TpLNIJFvWjtixQaOOZ9giUYyzJSPETr6D76JA2CD+aqiJ12M 1HwFYr9VZ+6SA== In-Reply-To: Feedback-ID: 44397038:user:proton X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279117 Archived-At: On Sunday, January 28th, 2024 at 08:15, Rudolf Schlatte wrote: >=20 >=20 > Tags: patch >=20 > Hi, >=20 > 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. >=20 > 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'. Thanks for working on this. The previous implementation (see bug#68226) provided an example where: foo: | line-one line-two Would become: foo: | line-one line-two When it should be: foo: | line-one line-two Your patch undoes this fix. I think I also ran into another bug using your patch: when inside a block s= calar, for example, running fill-paragraph will re-fill the whole file (or = parts of it at least). I agree that we shouldn't try to fill anything that isn't a comment or bloc= k scalar, and I also like the change in your other message where only the p= aragraph that point is on gets filled. BTW would it be possible to add tests for these? See `c-ts-mode-tests.el', = specifically `c-ts-mode-test-filling', for inspiration. Graham, you added `yaml-ts-mode--fill-paragraph' - what are your thoughts? = See also Rudolf's other message.