GNU bug report logs - #73877
30; rust-ts-mode: highlight the possible type suffix of number literals

Previous Next

Package: emacs;

Reported by: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>

Date: Sat, 19 Oct 2024 11:02:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#73877: closed (30; rust-ts-mode: highlight the possible type
 suffix of number literals)
Date: Sat, 23 Nov 2024 12:59:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 23 Nov 2024 14:58:02 +0200
with message-id <86y11aksyt.fsf <at> gnu.org>
and subject line Re: bug#73877: 30; rust-ts-mode: highlight the possible type suffix of number literals
has caused the debbugs.gnu.org bug report #73877,
regarding 30; rust-ts-mode: highlight the possible type suffix of number literals
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
73877: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73877
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 30; rust-ts-mode: highlight the possible type suffix of number
 literals
Date: Sat, 19 Oct 2024 10:56:02 +0000
[Message part 3 (text/plain, inline)]
Hi,

In order to make Rust number literals such as 1usize, 1.0_f64,... more legible, the type suffix should be highlighted.  The attached patch to rust-ts-mode does that.

Best,
Christophe

[0001-rust-ts-mode-highlight-the-possible-type-suffix-of-n.patch (text/x-diff, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Randy Taylor <dev <at> rjt.dev>
Cc: 73877-done <at> debbugs.gnu.org, Christophe.TROESTLER <at> umons.ac.be,
 stefankangas <at> gmail.com
Subject: Re: bug#73877: 30;
 rust-ts-mode: highlight the possible type suffix of number literals
Date: Sat, 23 Nov 2024 14:58:02 +0200
> Date: Fri, 22 Nov 2024 00:57:32 +0000
> From: Randy Taylor <dev <at> rjt.dev>
> Cc: "73877 <at> debbugs.gnu.org" <73877 <at> debbugs.gnu.org>, Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
> 
> On Monday, November 18th, 2024 at 10:14, Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be> wrote:
> > 
> > On 15 November 2024 at 01:11 +01, Randy Taylor dev <at> rjt.dev wrote:
> > 
> > > […] the patch didn't apply cleanly for me […]
> > 
> > 
> > Here is an updated version of the patch against today's master branch.
> 
> For some reason it still doesn't apply for me - not sure why. Maybe it's just me.
> I always do "git format-patch -1" to generate my patches.
> 
> > 
> > > […] If you do the same as treesit-font-lock-level, […]
> > 
> > 
> > For some reason it did not work in the past but it does now, so that's how I proceeded.
> > 
> > > You will also need to: (require 'rust-ts-mode)
> > 
> > 
> > Ok — some tests do that, others don't, so I did not originally change that. I've now added the “require”.
> > 
> > > After you make that change, I think you should be able to get rid of
> > > this:
> > > +(put 'rust-ts-mode-fontify-number-suffix-as-type 'safe-local-variable
> > > + 'booleanp)
> > 
> > 
> > I first thought that one may want to set that change for specific file but, you are right, it is more of a user choice that should be set in your own config. files.
> > 
> > > In the font-lock-number.rs file, it looks like there is an extraneous
> > > newline at the top of the file.
> > 
> > 
> > Fixed.
> > 
> > > BTW the current patch still doesn't apply against the latest master
> > > for me.
> > 
> > 
> > I have rebased it on the current origin/master.
> > 
> > Best,
> > C.
> 
> Thanks for working on this and putting up with me - the patch looks
> good to me. Eli, please install if you have no further comments.

Thanks, installed on master, and closing the bug.


This bug report was last modified 175 days ago.

Previous Next


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