GNU bug report logs - #70641
29.1.90; default-indent-new-line cannot put comment delimiter on c-ts-mode

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 70641 <at> debbugs.gnu.org, hskimse1 <at> gmail.com
Subject: bug#70641: 29.1.90; default-indent-new-line cannot put comment delimiter on  c-ts-mode
Date: Tue, 30 Apr 2024 14:21:53 +0300
> From: Yuan Fu <casouri <at> gmail.com>
> Date: Mon, 29 Apr 2024 21:57:18 -0700
> Cc: 김희석 <hskimse1 <at> gmail.com>,
>  70641 <at> debbugs.gnu.org
> 
> > c-mode defines a special value for comment-line-break-function,
> > whereas c-ts-mode does not.  Yuan, can you look into adding this?
> 
> This sounds like #70074. I’ve recently added a c-ts-mode version of comment-line-break-function on master. (That function works for any C-like language.)

Yes, I see that the master branch already has this issue fixed.
Thanks.

> >> 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?
> 
> Some languages formally defines different kinds of comments and the grammar tend to make the distinction between them. C grammar doesn’t make that distinction, everything is just comment.
> 
> That doesn’t stop us from adding a font-lock rule that fontifies /** comments in doc-face though. We can totally do that.

I think we should indeed do it.




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.