From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#69562: 29.2.50; go-ts-mode does not handle comments with fill-paragraph Date: Tue, 5 Mar 2024 16:49:44 +0200 Message-ID: <9078f92b-f567-42ce-8539-30eb7d097828@gutov.dev> References: <7676dd25-a1f2-440f-abd2-90b2ba69b20d@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23956"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 69562@debbugs.gnu.org To: Ankit Gadiya Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 05 15:50:49 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 1rhW7y-00061F-OY for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Mar 2024 15:50:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhW7l-0001Fk-UZ; Tue, 05 Mar 2024 09:50:34 -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 1rhW7k-0001Dh-GK for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2024 09:50:32 -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 1rhW7k-0002LI-7t for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2024 09:50:32 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rhW8E-0005uL-El for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2024 09:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Mar 2024 14:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69562 X-GNU-PR-Package: emacs Original-Received: via spool by 69562-submit@debbugs.gnu.org id=B69562.170965023022640 (code B ref 69562); Tue, 05 Mar 2024 14:51:02 +0000 Original-Received: (at 69562) by debbugs.gnu.org; 5 Mar 2024 14:50:30 +0000 Original-Received: from localhost ([127.0.0.1]:47064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhW7h-0005t5-Kk for submit@debbugs.gnu.org; Tue, 05 Mar 2024 09:50:30 -0500 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:54247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhW7e-0005sl-Hu for 69562@debbugs.gnu.org; Tue, 05 Mar 2024 09:50:28 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D5DD33200A10; Tue, 5 Mar 2024 09:49:48 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 05 Mar 2024 09:49:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1709650188; x=1709736588; bh=UaC2q/XYIGq3bQYcdW+UU6UGqOFJk/K33y+a/ytReC0=; b= lPFeQmGgq/AhieARxiX9r6YxjEMeXhcyVPYhGztDZ4mhWjCib+E7zPXlnHgeBGNO /rNa1wOpJfVxi4Rr28d+w4qDC061ZFAc3qpNkGv3MqaZGmlVCX/ojVjVmWog/gwj 2XjCst4k4mc/mV5VdG3ckZubbhgskrYHJ/6WFTS84SpaBi2rt+0j9yiCG1VvsjF1 XIqs+1qjNX2lJufVxJwTQWDt1zMaNfsvRVcn4hFxrUnIOFZB5wzRlEkKkP7QDYiO PBPvBna351xUp5rHGYOKFxXOBmFY/LRpUfr48EvtXRDpDsYWxYET+MnGF6Y71inV cqIbVErmS6TnRscsgxEClw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1709650188; x= 1709736588; bh=UaC2q/XYIGq3bQYcdW+UU6UGqOFJk/K33y+a/ytReC0=; b=m uebSz8DtMlJ+OeEZuoSIOpfHXpE+pzQkxMCOF0Bpg4dgJ5wZjAqVldg0d3+XEMG5 FckdnxIerAnRbtoP14rKfk+yAqfdmhcfeXRsmb69a3vmK1O8t6bWNrRNUH9mili9 Oe8iRWgMKetXqWRVl7wKps8v7ohJEtLMDvemgYiBHR5CMUI7OL4ZtDELj0tZXNtJ 6I/1A8AvdXhIdQ1xYzAwcWwCKd6Een1sEgRwNf7I8xkPl5rDGzEmWQpKAchIbfkw IaYTP84u3iEkd5X42HoN0DWBKTVAZiepGBpbZWojF9cPmAATJK7yIbbAcj/ni3rQ zbmDl+VPbGgmIEtiA9CUg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrheelgdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfvefhjggtgfesthejredttddvjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpefghfdttefhveeljeegtedtteelleeuleeuueektddvkeefheefudffffffkefh leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Mar 2024 09:49:47 -0500 (EST) Content-Language: en-US In-Reply-To: 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:281054 Archived-At: Please keep the bug address in Cc. The bug tracker does not forward the messages to others or save them in history otherwise. On 05/03/2024 16:22, Ankit Gadiya wrote: >> Does you example originally have one long commented line? Because when I >> try it that way, filling seems to work fine, comments are added on the >> new lines. > > Yes, I think the lines got wrapped in the mail but I had a long line. Admittedly > that sample is specifically to showcase the issue but a more realistic scenario > is when I already have multiline comments, I update it and want to re-fill > it. Here also, it is clear that fill-paragraph does not respect the comment > delimiter so it moves them just like regular characters. > > (all comment lines start with // in case mail adds line breaks) > > // Sample is a sample function with a very long comment. Sample is a > // new details added to the comment sample function with a very > long comment. Sample is a sample function > // with a very long comment. Sample is a sample function with a very long > // comment. > func Sample() { > > } > > Becomes this > > // Sample is a sample function with a very long comment. Sample is a // new > details added to the comment sample function with a very long > comment. Sample is > a sample function // with a very long comment. Sample is a sample > function with > a very long // comment. > func Sample() { > > } That's odd: here it becomes // Sample is a sample function with a very long comment. Sample is a // new details added to the comment sample function with a very long // comment. Sample is a sample function with a very long // comment. Sample is a sample function with a very long comment. func Sample() { } > I was able to reproduce it by running `emacs -Q` and manually enabling > go-ts-mode in the go file. Please note that in the `go-mode` ELPA package it > used to work as it defines its own fill-paragraph function. So possibly that > function might be triggered for you if you have that configured? I've also tried with 'emacs -Q', both the emacs-29 branch and master. The version you included in the bug report (ae80192d97b8d0e54a94290) is very recent, so there can't be any commits that changed things since. Are you testing in the same Emacs as the one you filed the bug report in? > Today @stebalien@emacs.ch suggested to set adaptive-fill-regexp for go-ts-mode > and that solved it for me (if this is useful). > > (setq-mode-local go-ts-mode adaptive-fill-regexp "[ \t]*//+[ \t]*") TBH I'm not yet sure what the value of this variable should look like. But if I manage to reproduce the bug on my machine, this will be the next thing we can try, thanks.