GNU bug report logs - #60529
[PATCH] Fontify C++ function definitions in c++-ts-mode

Previous Next

Package: emacs;

Reported by: Daniel Martín <mardani29 <at> yahoo.es>

Date: Tue, 3 Jan 2023 22:16:02 UTC

Severity: normal

Tags: patch

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 60529 in the body.
You can then email your comments to 60529 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#60529; Package emacs. (Tue, 03 Jan 2023 22:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Martín <mardani29 <at> yahoo.es>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 03 Jan 2023 22:16:02 GMT) Full text and rfc822 format available.

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

From: Daniel Martín <mardani29 <at> yahoo.es>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Fontify C++ function definitions in c++-ts-mode
Date: Tue, 03 Jan 2023 23:15:41 +0100
[Message part 1 (text/plain, inline)]
Tags: patch


Given the following valid C++ code:

void Foo::bar() {

}

c++-ts-mode should fontify bar with the font-lock-function-name-face
face.  The attached patch adds support for fontifying function
declarations whose identifier is "buried" inside qualified_identifier
nodes.

I've checked that the patch also fontifies bar in

void Foo::Bar::bar() {

}

but fontifies bar with font-lock-variable-name-face face in the
following cases:

Foo::Bar::Bar2 bar;
Foo::Bar bar;

I don't check for C++ mode in the code, as I think the impact of this
new check should be negligible for C code, but I'm open to feedback.

Thanks.

[0001-Fontify-C-function-definitions-in-c-ts-mode.patch (text/patch, attachment)]

Reply sent to Yuan Fu <casouri <at> gmail.com>:
You have taken responsibility. (Wed, 04 Jan 2023 06:51:02 GMT) Full text and rfc822 format available.

Notification sent to Daniel Martín <mardani29 <at> yahoo.es>:
bug acknowledged by developer. (Wed, 04 Jan 2023 06:51:02 GMT) Full text and rfc822 format available.

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

From: Yuan Fu <casouri <at> gmail.com>
To: Daniel Martín <mardani29 <at> yahoo.es>
Cc: 60529-done <at> debbugs.gnu.org
Subject: Re: bug#60529: [PATCH] Fontify C++ function definitions in c++-ts-mode
Date: Tue, 3 Jan 2023 23:50:08 -0700
Daniel Martín <mardani29 <at> yahoo.es> writes:

> Tags: patch
>
>
> Given the following valid C++ code:
>
> void Foo::bar() {
>
> }
>
> c++-ts-mode should fontify bar with the font-lock-function-name-face
> face.  The attached patch adds support for fontifying function
> declarations whose identifier is "buried" inside qualified_identifier
> nodes.
>
> I've checked that the patch also fontifies bar in
>
> void Foo::Bar::bar() {
>
> }
>
> but fontifies bar with font-lock-variable-name-face face in the
> following cases:
>
> Foo::Bar::Bar2 bar;
> Foo::Bar bar;
>
> I don't check for C++ mode in the code, as I think the impact of this
> new check should be negligible for C code, but I'm open to feedback.
>
> Thanks.

Makes sense. I applied the patch. Thanks!

Yuan




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

This bug report was last modified 2 years and 135 days ago.

Previous Next


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