GNU bug report logs - #78680
typescript-ts-mode "fills" code when using (fill-paragraph)

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>

Date: Tue, 3 Jun 2025 13:42:04 UTC

Severity: normal

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
Cc: 78680 <at> debbugs.gnu.org
Subject: bug#78680: typescript-ts-mode "fills" code when using (fill-paragraph)
Date: Tue, 03 Jun 2025 18:41:35 +0300
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.




This bug report was last modified 13 days ago.

Previous Next


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