GNU bug report logs - #63708
29.0.60; rust-ts-mode not properly handling apostrophe

Previous Next

Package: emacs;

Reported by: Йордан Миладинов <yordanm <at> proton.me>

Date: Thu, 25 May 2023 03:58:02 UTC

Severity: normal

Merged with 63709

Found in version 29.0.60

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: Randy Taylor <dev <at> rjt.dev>
To: Йордан Миладинов <yordanm <at> proton.me>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 63708 <at> debbugs.gnu.org, casouri <at> gmail.com
Subject: bug#63708: 29.0.60; rust-ts-mode not properly handling apostrophe
Date: Sat, 27 May 2023 03:00:09 +0000
On Friday, May 26th, 2023 at 15:14, Йордан Миладинов <yordanm <at> proton.me> wrote:
> Here's a patch that implements Randy's idea.
> 

Thanks for working on this!

This fix is indeed what I had in mind and I see that you also fixed another bug, thanks!
Eli, the changes to the existing loop are needed to apply the correct syntax properties
to type_parameters, which were previously incorrectly considered punctuation.
I think this is the safest fix for Emacs 29.

I have some other comments about the patch below.

+      (put-text-property (match-beginning 0)
+                         (match-end 0)
+                         'syntax-table
+                         '(7))))
                           ^^^
                           Do we want to use string-to-syntax here?

-  "Apply syntax text property to template delimiters between BEG and END.
+  "Apply proper syntax properties to various special characters with
+double meaning in Rust code between BEG and END.

Maybe "Apply syntax properties to various special characters with contextual meaning between BEG and END."?

-< and > are usually punctuation, e.g., as greater/less-than.  But
-when used for types, they should be considered pairs.
+Apostrophe (') is commonly treated as punctuation, but when used
+to define character literals, it should be treated as a string.

Maybe "Apostrophes (') are commonly treated as punctuation, but when used to define character literals, they should be treated as strings."?




This bug report was last modified 1 year and 355 days ago.

Previous Next


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