GNU bug report logs - #79587
Fontification: Numbers directly after a macro

Previous Next

Package: auctex;

Reported by: Arash Esbati <arash <at> gnu.org>

Date: Mon, 6 Oct 2025 21:15:02 UTC

Severity: normal

Done: Arash Esbati <arash <at> gnu.org>

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 79587 in the body.
You can then email your comments to 79587 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 tsdh <at> gnu.org, bug-auctex <at> gnu.org:
bug#79587; Package auctex. (Mon, 06 Oct 2025 21:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arash Esbati <arash <at> gnu.org>:
New bug report received and forwarded. Copy sent to tsdh <at> gnu.org, bug-auctex <at> gnu.org. (Mon, 06 Oct 2025 21:15:02 GMT) Full text and rfc822 format available.

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

From: Arash Esbati <arash <at> gnu.org>
To: "auctex-bugs" <bug-auctex <at> gnu.org>
Subject: Fontification: Numbers directly after a macro
Date: Mon, 06 Oct 2025 23:14:26 +0200
[Message part 1 (text/plain, inline)]
X-Debbugs-CC: tsdh <at> gnu.org

Hi all,

currently, \LaTeX3 is fontified like this:
[unpatched.png (image/png, inline)]
[Message part 3 (text/plain, inline)]
i.e., the 3 after the macro kills fontification of the macro \LaTeX.

It should actually look like this:
[patched.png (image/png, inline)]
[Message part 5 (text/plain, inline)]
This can be achieved with this change:

--8<---------------cut here---------------start------------->8---
diff --git a/font-latex.el b/font-latex.el
index ffba35cf..054e134c 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1284,7 +1284,9 @@ have changed."
 (defvar font-latex-syntax-alist
   ;; Use word syntax for @ because we use \> for matching macros and
   ;; we don't want \foo <at> bar to be found if we search for \foo.
-  '((?\( . ".") (?\) . ".") (?@ . "w"))
+  '((?\( . ".") (?\) . ".") (?@ . "w")
+    (?0 . ".") (?1 . ".") (?2 . ".") (?3 . ".") (?4 . ".")
+    (?5 . ".") (?6 . ".") (?7 . ".") (?8 . ".") (?9 . "."))
   "List of specifiers for the syntax alist of `font-lock-defaults'.")

 (defun font-latex-add-to-syntax-alist (list)
--8<---------------cut here---------------end--------------->8---

The patch changes the syntax of all numbers in `font-latex-syntax-alist'
to Punctuation so they are not matched by \>.  The tests we have pass
after this change.

Any comments?

Best, Arash

Reply sent to Arash Esbati <arash <at> gnu.org>:
You have taken responsibility. (Fri, 24 Oct 2025 15:22:01 GMT) Full text and rfc822 format available.

Notification sent to Arash Esbati <arash <at> gnu.org>:
bug acknowledged by developer. (Fri, 24 Oct 2025 15:22:02 GMT) Full text and rfc822 format available.

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

From: Arash Esbati <arash <at> gnu.org>
To: 79587-done <at> debbugs.gnu.org
Cc: tsdh <at> gnu.org
Subject: Re: bug#79587: Fontification: Numbers directly after a macro
Date: Fri, 24 Oct 2025 17:20:46 +0200
Arash Esbati <arash <at> gnu.org> writes:

> This can be achieved with this change:
>
> diff --git a/font-latex.el b/font-latex.el
> index ffba35cf..054e134c 100644
> --- a/font-latex.el
> +++ b/font-latex.el
> @@ -1284,7 +1284,9 @@ have changed."
>  (defvar font-latex-syntax-alist
>    ;; Use word syntax for @ because we use \> for matching macros and
>    ;; we don't want \foo <at> bar to be found if we search for \foo.
> -  '((?\( . ".") (?\) . ".") (?@ . "w"))
> +  '((?\( . ".") (?\) . ".") (?@ . "w")
> +    (?0 . ".") (?1 . ".") (?2 . ".") (?3 . ".") (?4 . ".")
> +    (?5 . ".") (?6 . ".") (?7 . ".") (?8 . ".") (?9 . "."))
>    "List of specifiers for the syntax alist of `font-lock-defaults'.")
>
>  (defun font-latex-add-to-syntax-alist (list)
>
> The patch changes the syntax of all numbers in `font-latex-syntax-alist'
> to Punctuation so they are not matched by \>.  The tests we have pass
> after this change.
>
> Any comments?

No comments, so I installed the proposed change, closing.

Best, Arash




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 22 Nov 2025 12:24:29 GMT) Full text and rfc822 format available.

This bug report was last modified 15 days ago.

Previous Next


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