From unknown Fri Jun 20 07:09:07 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#78680 <78680@debbugs.gnu.org> To: bug#78680 <78680@debbugs.gnu.org> Subject: Status: typescript-ts-mode "fills" code when using (fill-paragraph) Reply-To: bug#78680 <78680@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:09:07 +0000 retitle 78680 typescript-ts-mode "fills" code when using (fill-paragraph) reassign 78680 emacs submitter 78680 Konstantin Kharlamov severity 78680 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 03 09:41:53 2025 Received: (at submit) by debbugs.gnu.org; 3 Jun 2025 13:41:53 +0000 Received: from localhost ([127.0.0.1]:33378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uMRtm-0006le-3T for submit@debbugs.gnu.org; Tue, 03 Jun 2025 09:41:52 -0400 Received: from lists.gnu.org ([2001:470:142::17]:42574) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uMRth-0006kl-Ii for submit@debbugs.gnu.org; Tue, 03 Jun 2025 09:41:47 -0400 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 1uMRta-0005hI-J4 for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2025 09:41:38 -0400 Received: from forward100d.mail.yandex.net ([2a02:6b8:c41:1300:1:45:d181:d100]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uMRtX-0002S0-Tn for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2025 09:41:38 -0400 Received: from mail-nwsmtp-smtp-production-main-57.klg.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-57.klg.yp-c.yandex.net [IPv6:2a02:6b8:c42:73a9:0:640:b740:0]) by forward100d.mail.yandex.net (Yandex) with ESMTPS id 6C312609AE for ; Tue, 3 Jun 2025 16:41:28 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-57.klg.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id RfbJOxQLjiE0-Fv6nRJf6; Tue, 03 Jun 2025 16:41:28 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1748958088; bh=wHc+qWOEmONNj4SQ+Xd1ixWCMjLAb+TYyMRid//bA3U=; h=Date:To:From:Subject:Message-ID; b=K/rAKdGchkPYbRjIy4DFd44qGbwy8If8FGgtc401I7BVk8TQX0p8jv/FA/E3V8ycP +sSbp/OhIyjs+pZLLFzdj5yv2p4yJrrQ1DkHgwcuUz7wF8uIi6l1Rxhn7zE4TH3CZb 1Fghc8kiav6of0E2RT+Mhzy24CiZ2klFalRDR1OY= Authentication-Results: mail-nwsmtp-smtp-production-main-57.klg.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: Subject: typescript-ts-mode "fills" code when using (fill-paragraph) From: Konstantin Kharlamov To: bug-gnu-emacs@gnu.org Date: Tue, 03 Jun 2025 16:41:26 +0300 Content-Type: multipart/mixed; boundary="=-UjtbdAx+x3Dj1kSVEdMU" User-Agent: Evolution 3.56.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a02:6b8:c41:1300:1:45:d181:d100; envelope-from=hi-angel@yandex.ru; helo=forward100d.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-UjtbdAx+x3Dj1kSVEdMU Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This is on latest master (50e3bce315e). To reproduce: 1. Create test.ts with this content: // test console.log("hello world") 2. Open as `emacs -Q test.ts` 3. Evaluate (progn (require 'treesit) (typescript-ts-mode)) 4. Put caret at the word `test1` 5. Press M-q Expected: nothing. Actual: the code gets moved into the comment ------------- I investigated the problem, it seems to be because `fill-comment- function` is nil. From my understanding, it's supposed to be set by invoking a common helper (c-ts-common-comment-setup), which I implemented in the attached patch. I am testing this to make sure there wouldn't be any adverse effects. What's odd is that I don't seem to remember having this problem before, and; and as a matter of fact we even have investigated a bug #77727 which wouldn't be possible with this issue. Seems like a regression. --=-UjtbdAx+x3Dj1kSVEdMU Content-Disposition: attachment; filename="1.patch" Content-Type: text/x-patch; name="1.patch"; charset="UTF-8" Content-Transfer-Encoding: base64 RnJvbSA4NjlkMGI5NWJkNDlkZWQyYzY2MjIyZDZiOGFkMDI0MTZjYTFmNDY1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLb25zdGFudGluIEtoYXJsYW1vdiA8SGktQW5nZWxAeWFuZGV4 LnJ1PgpEYXRlOiBUdWUsIDMgSnVuIDIwMjUgMTY6MzI6MTQgKzAzMDAKU3ViamVjdDogW1BBVENI XSBTZXQgdXAgYy1saWtlIGNvbW1lbnRhcnkgaGVscGVycyBmb3IgdHlwZXNjcmlwdC10cyBtb2Rl cwoKQ3VycmVudGx5LCBydW5uaW5nIChmaWxsLXBhcmFncmF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Y29tbWVudC1zZXR1cCkKIAogICA7OyBFbGVj dHJpYwotLSAKMi40OS4wCgo= --=-UjtbdAx+x3Dj1kSVEdMU-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 03 12:48:25 2025 Received: (at 78680) by debbugs.gnu.org; 3 Jun 2025 16:48:25 +0000 Received: from localhost ([127.0.0.1]:40817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uMUoK-0000tl-Sv for submit@debbugs.gnu.org; Tue, 03 Jun 2025 12:48:25 -0400 Received: from forward501b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d501]:57938) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uMUoH-0000tE-Uv for 78680@debbugs.gnu.org; Tue, 03 Jun 2025 12:48:23 -0400 Received: from mail-nwsmtp-smtp-production-main-67.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-67.sas.yp-c.yandex.net [IPv6:2a02:6b8:c11:4ab1:0:640:c3ad:0]) by forward501b.mail.yandex.net (Yandex) with ESMTPS id 8E2BA616D6; Tue, 3 Jun 2025 19:14:03 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-67.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 2EeuWheLbW20-HLnj1T4G; Tue, 03 Jun 2025 19:14:03 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1748967243; bh=b2xd7OwSLImiCikg3lgGbL3l8msmu1f7ohn8CSpaFNw=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=s04N9LDEofvfwOUiaUGAWJQN40cMkVGwxog5rjRMrOP8WKwLOZHEvQ5DexA+nyU98 htG2XvhPb49wlKjilID7V0okrBr3+vfLb0hSyP9X+1AJLXP5MUy44vn8Fs1sidBNe9 pBYec75uSb3qavdNu6/++jRhK4GMsK/JX+8ykXJ8= Authentication-Results: mail-nwsmtp-smtp-production-main-67.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: Subject: Re: bug#78680: typescript-ts-mode "fills" code when using (fill-paragraph) From: Konstantin Kharlamov To: Juri Linkov Date: Tue, 03 Jun 2025 19:14:01 +0300 In-Reply-To: <878qm87ryo.fsf@mail.linkov.net> References: <878qm87ryo.fsf@mail.linkov.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.1 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78680 Cc: 78680@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, 2025-06-03 at 18:41 +0300, Juri Linkov wrote: > 'c-ts-common-comment-setup' is a too confusing name. > It does more than just setting comment-related variables. > So 8bccccedb65a should have retained 'c-ts-common-comment-setup'. > Therefore I restored it in js-ts-mode and typescript-ts-base-mode. So you did exactly same thing as my patch, but instead of applying mine to account for contribution since I researched the problem and wrote the code, you just wrote same thing yourself. This is not fair. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 03 12:50:30 2025 Received: (at 78680) by debbugs.gnu.org; 3 Jun 2025 16:50:30 +0000 Received: from localhost ([127.0.0.1]:40845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uMUqM-00015R-IY for submit@debbugs.gnu.org; Tue, 03 Jun 2025 12:50:30 -0400 Received: from mslow3.mail.gandi.net ([217.70.178.249]:60529) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uMUqK-000158-Vr; Tue, 03 Jun 2025 12:50:29 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by mslow3.mail.gandi.net (Postfix) with ESMTP id 0E708581A82; Tue, 3 Jun 2025 15:42:58 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id CA1271FCF0; Tue, 3 Jun 2025 15:42:56 +0000 (UTC) From: Juri Linkov To: Konstantin Kharlamov Subject: Re: bug#78680: typescript-ts-mode "fills" code when using (fill-paragraph) In-Reply-To: Organization: LINKOV.NET References: Date: Tue, 03 Jun 2025 18:41:35 +0300 Message-ID: <878qm87ryo.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: 0 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugdeifecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdefrddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeluddruddvledruddtfedrvdejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepfedprhgtphhtthhopegtohhnthhrohhlseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepjeekieektdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopefjihdqtehnghgvlheshigrnhguvgigrdhruh X-GND-Sasl: juri@linkov.net X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78680 Cc: 78680@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 78680 31.0.50 thanks > This is on latest master (50e3bce315e). To reproduce: > > 1. Create test.ts with this content: > > // test > console.log("hello world") > > 2. Open as `emacs -Q test.ts` > 3. Evaluate (progn (require 'treesit) (typescript-ts-mode)) > 4. Put caret at the word `test1` > 5. Press M-q > > Expected: nothing. > Actual: the code gets moved into the comment > > ------------- > > I investigated the problem, it seems to be because `fill-comment- > function` is nil. From my understanding, it's supposed to be set by > invoking a common helper (c-ts-common-comment-setup), which I > implemented in the attached patch. > > I am testing this to make sure there wouldn't be any adverse effects. > > What's odd is that I don't seem to remember having this problem before, > and; and as a matter of fact we even have investigated a bug #77727 > which wouldn't be possible with this issue. Seems like a regression. 'c-ts-common-comment-setup' is a too confusing name. It does more than just setting comment-related variables. So 8bccccedb65a should have retained 'c-ts-common-comment-setup'. Therefore I restored it in js-ts-mode and typescript-ts-base-mode. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 04 02:15:06 2025 Received: (at 78680) by debbugs.gnu.org; 4 Jun 2025 06:15:06 +0000 Received: from localhost ([127.0.0.1]:45970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uMhP0-0002Fh-2I for submit@debbugs.gnu.org; Wed, 04 Jun 2025 02:15:06 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:34551) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uMhOw-0002Dl-W8 for 78680@debbugs.gnu.org; Wed, 04 Jun 2025 02:15:03 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 750DB4397C; Wed, 4 Jun 2025 06:14:54 +0000 (UTC) From: Juri Linkov To: Konstantin Kharlamov Subject: Re: bug#78680: typescript-ts-mode "fills" code when using (fill-paragraph) In-Reply-To: Organization: LINKOV.NET References: <878qm87ryo.fsf@mail.linkov.net> Date: Wed, 04 Jun 2025 09:10:13 +0300 Message-ID: <87sekgf4uf.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: 0 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugdduieelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecunecujfgurhephffvvefujghofhffkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuggftrfgrthhtvghrnhepffegteefveelhfeljeefueehieduiedtfffhuddtkeeffffghfevheetgeeukeehnecukfhppeeluddruddvledruddtfedrvdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdefrddvjedphhgvlhhopehmrghilhdrghgrnhguihdrnhgvthdpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepjeekieektdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopefjihdqtehnghgvlheshigrnhguvgigrdhruh X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78680 Cc: 78680@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> 'c-ts-common-comment-setup' is a too confusing name. >> It does more than just setting comment-related variables. >> So 8bccccedb65a should have retained 'c-ts-common-comment-setup'. >> Therefore I restored it in js-ts-mode and typescript-ts-base-mode. > > So you did exactly same thing as my patch, but instead of applying mine > to account for contribution since I researched the problem and wrote > the code, you just wrote same thing yourself. This is not fair. Your commit message presented it as a new feature with motivations. Whereas I just reverted my recent mistake in two places: not only in typescript-ts-mode, but also in js-ts-mode. Thanks for finding this regression!