Subject: bug#70465: closed (Re: bug#70465: [PATCH] Add font-locking rule for Rust function signatures)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 22 Apr 2024 00:05:02 +0000

Your bug report

#70465: [PATCH] Add font-locking rule for Rust function signatures

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
70465: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70465
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#70465: [PATCH] Add font-locking rule for Rust function signatures
From: Yuan Fu <[email-masked]>
To: Noah Peart <[email-masked]>
Cc: [email-masked], Eli Zaretskii <[email-masked]>
Date: Sun, 21 Apr 2024 17:03:59 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

> On Apr 19, 2024, at 10:43 AM, Noah Peart <[email-masked]> wrote:
> 
> Got it, thanks!
> 
> On Fri, Apr 19, 2024 at 10:35 AM Eli Zaretskii <[email-masked]> wrote:
> > From: Noah Peart <[email-masked]>
> > Date: Fri, 19 Apr 2024 09:47:38 -0700
> > Cc: Yuan Fu <[email-masked]>, [email-masked]
> > 
> > > Please be sure to add the bug number to the commit log message when
> > you install this.
> > 
> > When submitting a patch, is there an easy way to add the bug number to
> > the commit?
> 
> Only after you get the bug report back from the bug tracker.  When you
> send the first message which creates a new bug report, you cannot know
> it.  So we only ask people to add the bug number if they submit a
> revised patch, because at that point the number is already known.
> When an original patch is installed, the person who pushes it must do
> a "git commit --amend" to edit the commit log message to add the bug
> number.

And merged.

Yuan

Subject: [PATCH] Add font-locking rule for Rust function signatures
From: Noah Peart <[email-masked]>
To: [email-masked]
Date: Thu, 18 Apr 2024 19:01:57 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

Adds a rule to font-lock Rust function signatures and missing function
modifier "default" to rust-ts-mode--keywords.

The new rule adds font-locking to signatures as in the following
example:

    trait Foo {
        fn foo() -> String;
//            ^ font-lock-function-name-face
    }

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo version 1.16.0) of 2024-04-18 built on noah-X580VD
Repository revision: 0a57dfcff8d0abcf4427cfbfd886264bb3b8eaab
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Ubuntu 22.04.4 LTS

Configured using:
 'configure --prefix=/usr/local --with-modules --with-tree-sitter
--with-threads --with-x-toolkit=gtk3 --with-xwidgets --with-gnutls
--with-json --with-mailutils --with-jpeg --with-png --with-rsvg
--with-tiff --with-xml2 --with-xpm --with-imagemagick CC=gcc-12
CXX=gcc-12'
From 1cce696ed89abe9fc3be5ea77b83c38e55c8a714 Mon Sep 17 00:00:00 2001
From: Noah Peart <[email-masked]>
Date: Thu, 18 Apr 2024 18:52:06 -0700
Subject: [PATCH] Add font-locking rule for Rust function signatures

* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--font-lock-settings): Add font-lock rule for Rust
function signatures and missing function modifier keyword 'default'.
---
 lisp/progmodes/rust-ts-mode.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el
index 7112ceced57..92978db64af 100644
--- a/lisp/progmodes/rust-ts-mode.el
+++ b/lisp/progmodes/rust-ts-mode.el
@@ -129,7 +129,7 @@ rust-ts-mode--builtin-macros
   "Rust built-in macros for tree-sitter font-locking.")
 
 (defvar rust-ts-mode--keywords
-  '("as" "async" "await" "break" "const" "continue" "dyn" "else"
+  '("as" "async" "await" "break" "const" "continue" "default" "dyn" "else"
     "enum" "extern" "fn" "for" "if" "impl" "in" "let" "loop" "match"
     "mod" "move" "pub" "ref" "return" "static" "struct" "trait" "type"
     "union" "unsafe" "use" "where" "while" (crate) (self) (super)
@@ -176,6 +176,7 @@ rust-ts-mode--font-lock-settings
    :language 'rust
    :feature 'definition
    '((function_item name: (identifier) @font-lock-function-name-face)
+     (function_signature_item name: (identifier) @font-lock-function-name-face)
      (macro_definition "macro_rules!" @font-lock-constant-face)
      (macro_definition (identifier) @font-lock-preprocessor-face)
      (field_declaration name: (field_identifier) @font-lock-property-name-face)
-- 
2.34.1