bug#80837: treesit-forward-comment off-by-one issue: overshoots by one character
Juri Linkov <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Organization | LINKOV.NET |
| Message-ID | <[email protected]> |
>>>> I'm very sorry to reopen it, but we still have the same problem
>>>> in the emacs-31 release branch. For example, try in c-ts-mode to
>>>> uncomment a comment, and it leaves the trailing */ comment endings.
>>>
>>> I'm not sure this is important enough to block the release, but we can
>>> at least discuss whether we think there is a possible small,
>>> non-invasive for the emacs-31 branch. Yuan, sorry to go back and forth
>>> so many times here, but do you think there is a way to do it less
>>> invasively?
>>
>> Leaving emacs-31 unfixed makes c-ts-mode somewhat unusable
>> since uncommenting is a frequent operation. If a small fix
>> for treesit-forward-comment is still unfeasible, then at least
>> we need to disable the 'comment' thing for c-ts-mode
>> in the release branch:
>>
>> diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
>> index 5f064716a89..3efbee6f8a7 100644
>> --- a/lisp/progmodes/c-ts-mode.el
>> +++ b/lisp/progmodes/c-ts-mode.el
>> @@ -1275,8 +1275,7 @@ c-ts-mode--thing-settings
>> "goto_statement"
>> "case_statement")))
>> (text ,(regexp-opt '("comment"
>> - "raw_string_literal")))
>> - (comment "comment"))
>> + "raw_string_literal"))))
>> "`treesit-thing-settings' for both C and C++.")
>
> Actually this makes a lot of sense. I don’t think we are missing anything
> by not using tree-sitter for the comment thing, forward/backward-comment
> already works perfectly fine without it. We can also add a comment to
> explain why we leave the comment thing out for c-ts-mode in the release
> version.
Eli and Sean, is this change ok to install on the release branch?