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.

Full log


View this message in rfc822 format

From: Filippo Argiolas <filippo.argiolas <at> gmail.com>
To: 75012 <at> debbugs.gnu.org
Subject: bug#75012: 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'





This bug report was last modified 140 days ago.

Previous Next


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