Subject: bug#72489: closed (Re: bug#72489: 29.4.50; forward-comment not working as expected in toml-ts-mode)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 17 Aug 2024 09:32:02 +0000

Your bug report

#72489: 29.4.50; forward-comment not working as expected in toml-ts-mode

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
72489: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72489
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#72489: 29.4.50; forward-comment not working as expected in toml-ts-mode
From: Eli Zaretskii <[email-masked]>
To: Jostein Kjønigsen <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Sat, 17 Aug 2024 12:31:00 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Jostein Kjønigsen <[email-masked]>
> Date: Thu, 15 Aug 2024 12:10:46 +0200
> Cc: Eli Zaretskii <[email-masked]>,
>  "Mr. Jostein Kjønigsen" <[email-masked]>,
>  [email-masked]
> 
>  On 7 Aug 2024, at 03:02, Yang Yingchao <[email-masked]> wrote:
> 
>  I think the error in your case also proves the misbehavior of forward-comment, and it breaks
>  `uncomment-region' in my case. And with the suggested fix applied, and then recompile/evaluate,
>  `uncomment-region' works as expected.
> 
>  Yang: Have you loaded/compiled/provided the toml typescript-grammar before using this mode?
> 
>  The *-ts-modes depends on external grammar in order to properly initialize the major-mode and
>  provide correct highlighting and indentation.
> 
>  I only have the required shared libraries (libtree-sitter.so & libtree-sitter-toml.so) installed. This should
>  be enough, right? At least `treesit-explore-mode' works fine in toml buffer.
> 
>  Regards,
> 
>  -- *Yang Yingchao*
> 
> I've recompiled from scratch and confirm this indeed fixes all issues mentioned.
> 
> Eli: Feel free to apply the supplied patch. I still don't have commit access :)
> 
> https://github.com/emacs-mirror/emacs/blob/e993e479c324bb720bca3f1cf194e55e32f01ccd/lisp/textmodes/toml-ts-mode.el#L53
> 
> 
>  ```
>  -    (modify-syntax-entry ?\n "> b"  table)
>  +    (modify-syntax-entry ?\n ">"  table)
>  ```

Thanks, installed on the emacs-30 branch, and closing the bug.

Subject: 29.4.50; forward-comment not working as expected in toml-ts-mode
From: Yang Yingchao <[email-masked]>
To: [email-masked]
Date: Tue, 06 Aug 2024 13:57:28 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Steps to reproduce:

1. Open a new buffer in `toml-ts-mode`.
2. Insert the following simple snippets:
```
# (forward-comment 1)
# [[keyboard.bindings]]
# chars = "a"
# key = "Tab"
# mods = "Alt"
```
3. Move the cursor to the first line and call `eval-last-sexp`.

This should move the cursor to the beginning of the line "chars = a", but actually it moves the cursor to the end of the whole block.

This might be an issue with `toml-ts-mode--syntax-table`.

Making a change in https://github.com/emacs-mirror/emacs/blob/e993e479c324bb720bca3f1cf194e55e32f01ccd/lisp/textmodes/toml-ts-mode.el#L53 can fix this issue:

```
-    (modify-syntax-entry ?\n "> b"  table)
+    (modify-syntax-entry ?\n ">"  table)
```

Regards

yang