Subject: Re: bug#68318: 30.0.50; Fontification of \{m\} and \{m,n\} in a regexp

From: Arash Esbati <[email-masked]>
Date: Thu, 11 Jan 2024 16:51:16 +0100

Andreas Schwab <[email-masked]> 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