* bug#75012: 31.0.50; Use a different face for storage_class in c-ts-mode doxygen comments
@ 2024-12-21 18:21 Filippo Argiolas
2024-12-21 21:18 ` Vincenzo Pupillo
0 siblings, 1 reply; 8+ messages in thread
From: Filippo Argiolas @ 2024-12-21 18:21 UTC (permalink / raw)
To: 75012
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'
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#75012: 31.0.50; Use a different face for storage_class in c-ts-mode doxygen comments
2024-12-21 18:21 bug#75012: 31.0.50; Use a different face for storage_class in c-ts-mode doxygen comments Filippo Argiolas
@ 2024-12-21 21:18 ` Vincenzo Pupillo
2024-12-22 6:20 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Vincenzo Pupillo @ 2024-12-21 21:18 UTC (permalink / raw)
To: 75012; +Cc: Eli Zaretskii, Filippo Argiolas
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'
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#75012: 31.0.50; Use a different face for storage_class in c-ts-mode doxygen comments
2024-12-21 21:18 ` Vincenzo Pupillo
@ 2024-12-22 6:20 ` Eli Zaretskii
2024-12-24 0:48 ` Yuan Fu
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-12-22 6:20 UTC (permalink / raw)
To: Vincenzo Pupillo, Yuan Fu; +Cc: filippo.argiolas, 75012
> From: Vincenzo Pupillo <v.pupillo@gmail.com>
> Cc: Filippo Argiolas <filippo.argiolas@gmail.com>,
> Eli Zaretskii <eliz@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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#75012: 31.0.50; Use a different face for storage_class in c-ts-mode doxygen comments
2024-12-22 6:20 ` Eli Zaretskii
@ 2024-12-24 0:48 ` Yuan Fu
2024-12-24 2:37 ` Stefan Kangas
0 siblings, 1 reply; 8+ messages in thread
From: Yuan Fu @ 2024-12-24 0:48 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Vincenzo Pupillo, filippo.argiolas, 75012
> On Dec 21, 2024, at 10:20 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> From: Vincenzo Pupillo <v.pupillo@gmail.com>
>> Cc: Filippo Argiolas <filippo.argiolas@gmail.com>,
>> Eli Zaretskii <eliz@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
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#75012: 31.0.50; Use a different face for storage_class in c-ts-mode doxygen comments
2024-12-24 0:48 ` Yuan Fu
@ 2024-12-24 2:37 ` Stefan Kangas
2024-12-25 7:32 ` Filippo Argiolas
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Kangas @ 2024-12-24 2:37 UTC (permalink / raw)
To: Yuan Fu, Eli Zaretskii; +Cc: Vincenzo Pupillo, filippo.argiolas, 75012
Yuan Fu <casouri@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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#75012: 31.0.50; Use a different face for storage_class in c-ts-mode doxygen comments
2024-12-24 2:37 ` Stefan Kangas
@ 2024-12-25 7:32 ` Filippo Argiolas
2024-12-25 8:29 ` Yuan Fu
0 siblings, 1 reply; 8+ messages in thread
From: Filippo Argiolas @ 2024-12-25 7:32 UTC (permalink / raw)
To: Stefan Kangas, Yuan Fu, Eli Zaretskii; +Cc: Vincenzo Pupillo, 75012
Stefan Kangas <stefankangas@gmail.com> writes:
> Yuan Fu <casouri@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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#75012: 31.0.50; Use a different face for storage_class in c-ts-mode doxygen comments
2024-12-25 7:32 ` Filippo Argiolas
@ 2024-12-25 8:29 ` Yuan Fu
2024-12-26 7:54 ` Filippo Argiolas
0 siblings, 1 reply; 8+ messages in thread
From: Yuan Fu @ 2024-12-25 8:29 UTC (permalink / raw)
To: Filippo Argiolas; +Cc: Eli Zaretskii, Vincenzo Pupillo, Stefan Kangas, 75012
> On Dec 24, 2024, at 11:32 PM, Filippo Argiolas <filippo.argiolas@gmail.com> wrote:
>
> Stefan Kangas <stefankangas@gmail.com> writes:
>
>> Yuan Fu <casouri@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
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#75012: 31.0.50; Use a different face for storage_class in c-ts-mode doxygen comments
2024-12-25 8:29 ` Yuan Fu
@ 2024-12-26 7:54 ` Filippo Argiolas
0 siblings, 0 replies; 8+ messages in thread
From: Filippo Argiolas @ 2024-12-26 7:54 UTC (permalink / raw)
To: Yuan Fu; +Cc: Eli Zaretskii, Vincenzo Pupillo, Stefan Kangas, 75012
[-- Attachment #1: Type: text/plain, Size: 967 bytes --]
Yuan Fu <casouri@gmail.com> writes:
>> On Dec 24, 2024, at 11:32 PM, Filippo Argiolas <filippo.argiolas@gmail.com> wrote:
>>
>> Stefan Kangas <stefankangas@gmail.com> writes:
>>
>>> Yuan Fu <casouri@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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Improve-doxygen-comments-font-lock-rules-in-c-ts-mod.patch --]
[-- Type: text/x-patch, Size: 1208 bytes --]
From 09b26c95fce881a375393864c9487c1f4d45f05a Mon Sep 17 00:00:00 2001
From: Filippo Argiolas <filippo.argiolas@gmail.com>
Date: Thu, 26 Dec 2024 08:06:55 +0100
Subject: [PATCH] Improve doxygen comments font lock rules in c-ts modes
* lisp/progmodes/c-ts-common.el
(c-ts-mode-doxygen-comment-font-lock-settings): Add rules for type,
storageclass and note/warning/error tags. (Bug#75012)
Copyright-paperwork-exempt: yes
---
lisp/progmodes/c-ts-common.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/c-ts-common.el b/lisp/progmodes/c-ts-common.el
index 25b386cbaa7..7a0b2660095 100644
--- a/lisp/progmodes/c-ts-common.el
+++ b/lisp/progmodes/c-ts-common.el
@@ -397,7 +397,12 @@ c-ts-mode-doxygen-comment-font-lock-settings
:override t
:feature 'keyword
'((tag_name) @font-lock-constant-face
- (storageclass) @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)
:language 'doxygen
:override t
--
2.47.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-12-26 7:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-21 18:21 bug#75012: 31.0.50; Use a different face for storage_class in c-ts-mode doxygen comments Filippo Argiolas
2024-12-21 21:18 ` Vincenzo Pupillo
2024-12-22 6:20 ` Eli Zaretskii
2024-12-24 0:48 ` Yuan Fu
2024-12-24 2:37 ` Stefan Kangas
2024-12-25 7:32 ` Filippo Argiolas
2024-12-25 8:29 ` Yuan Fu
2024-12-26 7:54 ` Filippo Argiolas
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).