Subject: bug#74308: closed (Re: bug#74307: 30.0.92; emacs-lisp font-locking word regexp)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 16 Nov 2024 14:24:02 +0000

Your bug report

#74307: 30.0.92; emacs-lisp font-locking word regexp

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
74307: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74307
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#74307: 30.0.92; emacs-lisp font-locking word regexp
From: Eli Zaretskii <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 16 Nov 2024 16:22:55 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Stefan Monnier <[email-masked]>
> Cc: Roland Winkler <[email-masked]>,  [email-masked]
> Date: Thu, 14 Nov 2024 11:24:48 -0500
> 
> > I believe you are saying that in
> >
> >          (,(rx "\\\\" (or (seq "<" (group-n 1 lisp-mode-symbol) ">")
> >                           (seq "{" (group-n 1 lisp-mode-symbol) "}")))
> >           (1 font-lock-variable-name-face prepend))
> >
> > we should use something like the below instead?
> >
> >      (,(rx "\\\\" (or (seq "<" (group-n 1 lisp-mode-symbol) (not "\\\\") ">")
> >                       (seq "{" (group-n 1 lisp-mode-symbol) (not "\\\\") "}"))
> >
> > And similarly for \\[] etc.?
> 
> Sounds good to me.

Thanks, installed on master, and closing the bug.

Subject: 30.0.92; emacs-lisp font-locking word regexp
From: Roland Winkler <[email-masked]>
To: [email-masked]
Date: Mon, 11 Nov 2024 00:30:46 -0600
List-Id: <debbugs-submit.debbugs.gnu.org>

Starting from emacs -Q, put the following into a buffer with
emacs-lisp-mode

  (setq foo "\\<foo\\>")

The part "foo\\" of the string "\\<foo\\>" will get
font-lock-variable-name-face, which looks odd.

I believe, this is due to a clause in lisp-mode.el that says

         ;; Words inside \\[], \\<>, \\{} or \\`' tend to be for
         ;; `substitute-command-keys'.

But this assumption is not always correct, in particular if ">" is
preceded by "\\", which happens when constructing regexps.