GNU bug report logs - #75012
31.0.50; Use a different face for storage_class in c-ts-mode doxygen comments

Previous Next

Package: emacs;

Reported by: Filippo Argiolas <filippo.argiolas <at> gmail.com>

Date: Sat, 21 Dec 2024 18:24:02 UTC

Severity: wishlist

Tags: patch

Found in version 31.0.50

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75012 in the body.
You can then email your comments to 75012 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Sat, 21 Dec 2024 18:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Filippo Argiolas <filippo.argiolas <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 21 Dec 2024 18:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Filippo Argiolas <filippo.argiolas <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Use a different face for storage_class in c-ts-mode
 doxygen comments
Date: Sat, 21 Dec 2024 19:21:29 +0100
Hi, I was experimenting with the new local parser for doxygen comments
in c-ts-mode.

I think current syntax highlighting rules really basic and could use
some love.  One thing that would really help IMHO would be using a
different face for storage class so that e.g.

@param[in] some param

have param and [in] with two different colors. Param type is detected as
"storage_class" and that's usually fontified with font-lock-keyword-face
(e.g. like const and static in C) so I believe that would be the most
obvious choice.

I also have been experimenting with some additional rules in
c-ts-mode-doxygen-comment-font-lock-settings but they may be overkill:

   :language 'doxygen
   :override t
   :feature 'keyword
   '((tag_name) @font-lock-constant-face
     (type) @font-lock-type-face
     (emphasis) @bold
     ((tag_name) @bold (:match ".note" @bold))
     ((tag_name) @warning (:match ".warning" @warning))
     ((tag_name) @error (:match ".error" @error))
     (storageclass) @font-lock-keyword-face)

gets me something like the 'after' screenshot here[1], the 'before' now
is current faces with ef-dream theme.

What do you think?

Thanks,
Filippo


1. https://people.freedesktop.org/~fargiolas/c-ts-doxy/





In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.1.0, NS
 appkit-2575.20 Version 15.1.1 (Build 24B91)) of 2024-12-21 built on mba
Repository revision: 1c960bda91237c92f9f602bcb8538ad500c0bc49
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2575
System Description:  macOS 15.1.1

Configured using:
 'configure --with-tree-sitter --with-native-compilation'





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Sat, 21 Dec 2024 21:19:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
To: 75012 <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
Cc: Eli Zaretskii <eliz <at> gnu.org>, Filippo Argiolas <filippo.argiolas <at> gmail.com>
Subject: Re: bug#75012: 31.0.50;
 Use a different face for storage_class in c-ts-mode doxygen comments
Date: Sat, 21 Dec 2024 22:18:08 +0100
Ciao Filippo, 
it's fine for me, even the "overkill" version.
@Eli WDYT ?

Vincenzo

In data sabato 21 dicembre 2024 19:21:29 Ora standard dell’Europa centrale, 
Filippo Argiolas ha scritto:
> Hi, I was experimenting with the new local parser for doxygen comments
> in c-ts-mode.
> 
> I think current syntax highlighting rules really basic and could use
> some love.  One thing that would really help IMHO would be using a
> different face for storage class so that e.g.
> 
> @param[in] some param
> 
> have param and [in] with two different colors. Param type is detected as
> "storage_class" and that's usually fontified with font-lock-keyword-face
> (e.g. like const and static in C) so I believe that would be the most
> obvious choice.
> 
> I also have been experimenting with some additional rules in
> 
> c-ts-mode-doxygen-comment-font-lock-settings but they may be overkill:
>    :language 'doxygen
>    :override t
>    :feature 'keyword
> 
>    '((tag_name) @font-lock-constant-face
>      (type) @font-lock-type-face
>      (emphasis) @bold
>      ((tag_name) @bold (:match ".note" @bold))
>      ((tag_name) @warning (:match ".warning" @warning))
>      ((tag_name) @error (:match ".error" @error))
>      (storageclass) @font-lock-keyword-face)
> 
> gets me something like the 'after' screenshot here[1], the 'before' now
> is current faces with ef-dream theme.
> 
> What do you think?
> 
> Thanks,
> Filippo
> 
> 
> 1. https://people.freedesktop.org/~fargiolas/c-ts-doxy/
> 
> 
> 
> 
> 
> In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.1.0, NS
>  appkit-2575.20 Version 15.1.1 (Build 24B91)) of 2024-12-21 built on mba
> Repository revision: 1c960bda91237c92f9f602bcb8538ad500c0bc49
> Repository branch: master
> Windowing system distributor 'Apple', version 10.3.2575
> System Description:  macOS 15.1.1
> 
> Configured using:
>  'configure --with-tree-sitter --with-native-compilation'








Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Sat, 21 Dec 2024 21:20:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Sun, 22 Dec 2024 06:21:02 GMT) Full text and rfc822 format available.

Message #14 received at 75012 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Vincenzo Pupillo <v.pupillo <at> gmail.com>,
 Yuan Fu <casouri <at> gmail.com>
Cc: filippo.argiolas <at> gmail.com, 75012 <at> debbugs.gnu.org
Subject: Re: bug#75012: 31.0.50;
 Use a different face for storage_class in c-ts-mode doxygen comments
Date: Sun, 22 Dec 2024 08:20:42 +0200
> From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
> Cc: Filippo Argiolas <filippo.argiolas <at> gmail.com>,
>  Eli Zaretskii <eliz <at> gnu.org>
> Date: Sat, 21 Dec 2024 22:18:08 +0100
> 
> Ciao Filippo, 
> it's fine for me, even the "overkill" version.
> @Eli WDYT ?

I don't have an opinion on this, but Yuan (CC'ed) might.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Tue, 24 Dec 2024 00:50:02 GMT) Full text and rfc822 format available.

Message #17 received at 75012 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Vincenzo Pupillo <v.pupillo <at> gmail.com>, filippo.argiolas <at> gmail.com,
 75012 <at> debbugs.gnu.org
Subject: Re: bug#75012: 31.0.50; Use a different face for storage_class in
 c-ts-mode doxygen comments
Date: Mon, 23 Dec 2024 16:48:11 -0800

> On Dec 21, 2024, at 10:20 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
>> Cc: Filippo Argiolas <filippo.argiolas <at> gmail.com>,
>> Eli Zaretskii <eliz <at> gnu.org>
>> Date: Sat, 21 Dec 2024 22:18:08 +0100
>> 
>> Ciao Filippo, 
>> it's fine for me, even the "overkill" version.
>> @Eli WDYT ?
> 
> I don't have an opinion on this, but Yuan (CC'ed) might.

Thanks for the ping. From the screenshot it looks very nice! If no one objects I think we should merge this.

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Tue, 24 Dec 2024 02:39:01 GMT) Full text and rfc822 format available.

Message #20 received at 75012 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Yuan Fu <casouri <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: Vincenzo Pupillo <v.pupillo <at> gmail.com>, filippo.argiolas <at> gmail.com,
 75012 <at> debbugs.gnu.org
Subject: Re: bug#75012: 31.0.50; Use a different face for storage_class in
 c-ts-mode doxygen comments
Date: Tue, 24 Dec 2024 02:37:36 +0000
Yuan Fu <casouri <at> gmail.com> writes:

> Thanks for the ping. From the screenshot it looks very nice! If no one
> objects I think we should merge this.

Sounds good to me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Wed, 25 Dec 2024 07:34:02 GMT) Full text and rfc822 format available.

Message #23 received at 75012 <at> debbugs.gnu.org (full text, mbox):

From: Filippo Argiolas <filippo.argiolas <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>, Yuan Fu <casouri <at> gmail.com>, Eli
 Zaretskii <eliz <at> gnu.org>
Cc: Vincenzo Pupillo <v.pupillo <at> gmail.com>, 75012 <at> debbugs.gnu.org
Subject: Re: bug#75012: 31.0.50; Use a different face for storage_class in
 c-ts-mode doxygen comments
Date: Wed, 25 Dec 2024 08:32:45 +0100
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Yuan Fu <casouri <at> gmail.com> writes:
>
>> Thanks for the ping. From the screenshot it looks very nice! If no one
>> objects I think we should merge this.
>
> Sounds good to me.

Great! If you go ahead and install this feel free to take this as a
trivial suggestion as I still don't have the signed agreement.

Thanks!
Filippo


PS sorry for all the typos in the first email, hit C-c too quickly
without proofreading it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Wed, 25 Dec 2024 08:31:02 GMT) Full text and rfc822 format available.

Message #26 received at 75012 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Filippo Argiolas <filippo.argiolas <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Vincenzo Pupillo <v.pupillo <at> gmail.com>,
 Stefan Kangas <stefankangas <at> gmail.com>, 75012 <at> debbugs.gnu.org
Subject: Re: bug#75012: 31.0.50; Use a different face for storage_class in
 c-ts-mode doxygen comments
Date: Wed, 25 Dec 2024 00:29:29 -0800

> On Dec 24, 2024, at 11:32 PM, Filippo Argiolas <filippo.argiolas <at> gmail.com> wrote:
> 
> Stefan Kangas <stefankangas <at> gmail.com> writes:
> 
>> Yuan Fu <casouri <at> gmail.com> writes:
>> 
>>> Thanks for the ping. From the screenshot it looks very nice! If no one
>>> objects I think we should merge this.
>> 
>> Sounds good to me.
> 
> Great! If you go ahead and install this feel free to take this as a
> trivial suggestion as I still don't have the signed agreement.

Your patch seems to be within 15 LOC, in that case we can apply it even without the assignment (unless you’ve used the 15 LOC wavier before). Do you want to submit a patch?

> PS sorry for all the typos in the first email, hit C-c too quickly
> without proofreading it.

No worries :-) English isn’t my native language and I make typos and grammar errors all the time.

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Wed, 25 Dec 2024 08:31:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Thu, 26 Dec 2024 07:56:02 GMT) Full text and rfc822 format available.

Message #32 received at 75012 <at> debbugs.gnu.org (full text, mbox):

From: Filippo Argiolas <filippo.argiolas <at> gmail.com>
To: Yuan Fu <casouri <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Vincenzo Pupillo <v.pupillo <at> gmail.com>,
 Stefan Kangas <stefankangas <at> gmail.com>, 75012 <at> debbugs.gnu.org
Subject: Re: bug#75012: 31.0.50; Use a different face for storage_class in
 c-ts-mode doxygen comments
Date: Thu, 26 Dec 2024 08:54:04 +0100
[Message part 1 (text/plain, inline)]
Yuan Fu <casouri <at> gmail.com> writes:

>> On Dec 24, 2024, at 11:32 PM, Filippo Argiolas <filippo.argiolas <at> gmail.com> wrote:
>> 
>> Stefan Kangas <stefankangas <at> gmail.com> writes:
>> 
>>> Yuan Fu <casouri <at> gmail.com> writes:
>>> 
>>>> Thanks for the ping. From the screenshot it looks very nice! If no one
>>>> objects I think we should merge this.
>>> 
>>> Sounds good to me.
>> 
>> Great! If you go ahead and install this feel free to take this as a
>> trivial suggestion as I still don't have the signed agreement.
>
> Your patch seems to be within 15 LOC, in that case we can apply it even without the assignment (unless you’ve used the 15 LOC wavier before). Do you want to submit a patch?
>

I have two 'Co-authored' commits, mostly doc changes were I was involved
in the discussion but I wouldn't say I authored, and one 'Suggested by'
trivial bug fix.

I guess I'm still within the trivial realm, patch attached.

Thanks,
Filippo

[0001-Improve-doxygen-comments-font-lock-rules-in-c-ts-mod.patch (text/x-patch, attachment)]

Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 02 Jan 2025 01:27:01 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 02 Jan 2025 01:27:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Thu, 02 Jan 2025 03:31:04 GMT) Full text and rfc822 format available.

Message #39 received at 75012 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Filippo Argiolas <filippo.argiolas <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Vincenzo Pupillo <v.pupillo <at> gmail.com>,
 Stefan Kangas <stefankangas <at> gmail.com>, 75012 <at> debbugs.gnu.org
Subject: Re: bug#75012: 31.0.50; Use a different face for storage_class in
 c-ts-mode doxygen comments
Date: Wed, 1 Jan 2025 19:29:47 -0800

> On Dec 25, 2024, at 11:54 PM, Filippo Argiolas <filippo.argiolas <at> gmail.com> wrote:
> 
> Yuan Fu <casouri <at> gmail.com> writes:
> 
>>> On Dec 24, 2024, at 11:32 PM, Filippo Argiolas <filippo.argiolas <at> gmail.com> wrote:
>>> 
>>> Stefan Kangas <stefankangas <at> gmail.com> writes:
>>> 
>>>> Yuan Fu <casouri <at> gmail.com> writes:
>>>> 
>>>>> Thanks for the ping. From the screenshot it looks very nice! If no one
>>>>> objects I think we should merge this.
>>>> 
>>>> Sounds good to me.
>>> 
>>> Great! If you go ahead and install this feel free to take this as a
>>> trivial suggestion as I still don't have the signed agreement.
>> 
>> Your patch seems to be within 15 LOC, in that case we can apply it even without the assignment (unless you’ve used the 15 LOC wavier before). Do you want to submit a patch?
>> 
> 
> I have two 'Co-authored' commits, mostly doc changes were I was involved
> in the discussion but I wouldn't say I authored, and one 'Suggested by'
> trivial bug fix.
> 
> I guess I'm still within the trivial realm, patch attached.

Thanks! Just to make sure, Eli, are we good to apply Filippo’s patch with assignment waiver?

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Thu, 02 Jan 2025 05:01:02 GMT) Full text and rfc822 format available.

Message #42 received at 75012 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Yuan Fu <casouri <at> gmail.com>, Filippo Argiolas <filippo.argiolas <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Vincenzo Pupillo <v.pupillo <at> gmail.com>,
 75012 <at> debbugs.gnu.org
Subject: Re: bug#75012: 31.0.50; Use a different face for storage_class in
 c-ts-mode doxygen comments
Date: Wed, 1 Jan 2025 23:00:12 -0600
Yuan Fu <casouri <at> gmail.com> writes:

>> On Dec 25, 2024, at 11:54 PM, Filippo Argiolas <filippo.argiolas <at> gmail.com> wrote:
>>
>> I guess I'm still within the trivial realm, patch attached.
>
> Thanks! Just to make sure, Eli, are we good to apply Filippo’s patch with assignment waiver?

It's less than the ~15 lines we usually allow for, and Filippo has no
other contributions in git, so I think we're good.

Don't forget to add this trailer to the commit message, as usual:

Copyright-paperwork-exempt: yes




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75012; Package emacs. (Thu, 02 Jan 2025 06:44:02 GMT) Full text and rfc822 format available.

Message #45 received at 75012 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: casouri <at> gmail.com, v.pupillo <at> gmail.com, filippo.argiolas <at> gmail.com,
 75012 <at> debbugs.gnu.org
Subject: Re: bug#75012: 31.0.50; Use a different face for storage_class in
 c-ts-mode doxygen comments
Date: Thu, 02 Jan 2025 08:43:43 +0200
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Wed, 1 Jan 2025 23:00:12 -0600
> Cc: Eli Zaretskii <eliz <at> gnu.org>, Vincenzo Pupillo <v.pupillo <at> gmail.com>, 75012 <at> debbugs.gnu.org
> 
> Yuan Fu <casouri <at> gmail.com> writes:
> 
> >> On Dec 25, 2024, at 11:54 PM, Filippo Argiolas <filippo.argiolas <at> gmail.com> wrote:
> >>
> >> I guess I'm still within the trivial realm, patch attached.
> >
> > Thanks! Just to make sure, Eli, are we good to apply Filippo’s patch with assignment waiver?
> 
> It's less than the ~15 lines we usually allow for, and Filippo has no
> other contributions in git, so I think we're good.
> 
> Don't forget to add this trailer to the commit message, as usual:
> 
> Copyright-paperwork-exempt: yes

Right.




Reply sent to Yuan Fu <casouri <at> gmail.com>:
You have taken responsibility. (Sat, 04 Jan 2025 08:24:02 GMT) Full text and rfc822 format available.

Notification sent to Filippo Argiolas <filippo.argiolas <at> gmail.com>:
bug acknowledged by developer. (Sat, 04 Jan 2025 08:24:02 GMT) Full text and rfc822 format available.

Message #50 received at 75012-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Vincenzo Pupillo <v.pupillo <at> gmail.com>,
 Filippo Argiolas <filippo.argiolas <at> gmail.com>,
 Stefan Kangas <stefankangas <at> gmail.com>, 75012-done <at> debbugs.gnu.org
Subject: Re: bug#75012: 31.0.50; Use a different face for storage_class in
 c-ts-mode doxygen comments
Date: Sat, 4 Jan 2025 00:23:10 -0800

> On Jan 1, 2025, at 10:43 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Stefan Kangas <stefankangas <at> gmail.com>
>> Date: Wed, 1 Jan 2025 23:00:12 -0600
>> Cc: Eli Zaretskii <eliz <at> gnu.org>, Vincenzo Pupillo <v.pupillo <at> gmail.com>, 75012 <at> debbugs.gnu.org
>> 
>> Yuan Fu <casouri <at> gmail.com> writes:
>> 
>>>> On Dec 25, 2024, at 11:54 PM, Filippo Argiolas <filippo.argiolas <at> gmail.com> wrote:
>>>> 
>>>> I guess I'm still within the trivial realm, patch attached.
>>> 
>>> Thanks! Just to make sure, Eli, are we good to apply Filippo’s patch with assignment waiver?
>> 
>> It's less than the ~15 lines we usually allow for, and Filippo has no
>> other contributions in git, so I think we're good.
>> 
>> Don't forget to add this trailer to the commit message, as usual:
>> 
>> Copyright-paperwork-exempt: yes
> 
> Right.

Ok, thanks. I pushed the patch to master. Thanks again, Fillippo!

Yuan



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 01 Feb 2025 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 139 days ago.

Previous Next


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