GNU bug report logs - #68318
30.0.50; Fontification of \{m\} and \{m,n\} in a regexp

Previous Next

Package: emacs;

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

Date: Mon, 8 Jan 2024 09:27:02 UTC

Severity: minor

Found in version 30.0.50

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: Arash Esbati <arash <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 68318 <at> debbugs.gnu.org
Subject: bug#68318: 30.0.50; Fontification of \{m\} and \{m,n\} in a regexp
Date: Thu, 11 Jan 2024 16:51:16 +0100
Andreas Schwab <schwab <at> linux-m68k.org> writes:

> See lisp-el-font-lock-keywords-2 in lisp-mode.el:
>
>          ;; Words inside \\[], \\<>, \\{} or \\`' tend to be for
>          ;; `substitute-command-keys'.

Thanks for the pointer.  I'm not familiar with the code, but IIUC, the
lines 499-500 are relevant, where the condense is:

  (rx "\\\\" (seq "{" (group-n 1 lisp-mode-symbol) "}"))

which returns:

  "\\\\\\\\{\\(?1:\\(?:\\w\\|\\s_\\|\\\\.\\)+\\)}"

Since we're talking about \\{\\} and not \\{}, I wonder if some
variation like:

  "\\\\\\\\{\\(?1:\\(?:\\w\\|\\s_\\|\\\\.\\)*?[^\\]\\)}"

would fix this issue?  Not sure if it does TRT reg. the "\\\\." part.

Best, Arash




This bug report was last modified 238 days ago.

Previous Next


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