GNU bug report logs -
#70641
29.1.90; default-indent-new-line cannot put comment delimiter on c-ts-mode
Previous Next
Reported by: 김희석 <hskimse1 <at> gmail.com>
Date: Mon, 29 Apr 2024 05:16:02 UTC
Severity: normal
Found in version 29.1.90
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 70641 <at> debbugs.gnu.org (full text, mbox):
> From: 김희석 <hskimse1 <at> gmail.com>
> Date: Mon, 29 Apr 2024 11:12:35 +0900
>
>
>
> On c-mode, deurn default-indent-new-line auto-indent and
> put delimitors on multiple lines of comment.
>
> For example, if there is comments like this:
> /**
> * Comment like
> * this []
> */
> When I press M-j (default-indent-new-line) on the point [], on
> c-mode, emacs indent and put comment delimiter automatically
> like this:
> /**
> * Comment like
> * this
> * []
> */
> However on c-ts-mode, it does not works. It indents well, but
> could not find or put the comment delimiter on new line when
> I press M-j.
> /**
> * Comment like
> * this
> []
> */
> On c-ts-mode, I found that the default value of variable comment-multi-line
> is nil, which was t on c-mode, and above behavior is happend when I set
> this value to t. When it was nil, comment become like this:
> /**
> * Comment like
> * this *//*
> []
> */
> Which is intended behavior.
c-mode defines a special value for comment-line-break-function,
whereas c-ts-mode does not. Yuan, can you look into adding this?
> Also, on c-mode, when I write multiple lines of comment with first line
> of comment is "/**", (like above examples) that block is set to have
> the same font-lock face as string to make it easier to read, but
> in c-ts-mode that behavior doesn't happen and they all have
> the same face.
That's a completely separate issue, which should have been reported
separately. It looks like c-mode uses font-lock-doc-face in those
comments, not font-lock-comment-face. See the various uses of
c-font-lock-doc-comments in cc-fonts.el. AFAIR, these features are
beginning to be supported by the tree-sitter grammar itself, we just
need to use that in our font-lock definitions? Yuan, any comments?
This bug report was last modified 155 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.