GNU bug report logs - #74307
30.0.92; emacs-lisp font-locking word regexp

Previous Next

Package: emacs;

Reported by: Roland Winkler <winkler <at> gnu.org>

Date: Mon, 11 Nov 2024 06:30:02 UTC

Severity: normal

Merged with 74308

Found in version 30.0.92

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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#74307: closed (30.0.92; emacs-lisp font-locking word regexp)
Date: Sat, 16 Nov 2024 14:24:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 16 Nov 2024 16:22:55 +0200
with message-id <865xongsw0.fsf <at> gnu.org>
and subject line Re: bug#74307: 30.0.92; emacs-lisp font-locking word regexp
has caused the debbugs.gnu.org bug report #74307,
regarding 30.0.92; emacs-lisp font-locking word regexp
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
74307: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74307
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Roland Winkler <winkler <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.92; emacs-lisp font-locking word regexp
Date: Mon, 11 Nov 2024 00:28:34 -0600
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.


[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 74307-done <at> debbugs.gnu.org, winkler <at> gnu.org
Subject: Re: bug#74307: 30.0.92; emacs-lisp font-locking word regexp
Date: Sat, 16 Nov 2024 16:22:55 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Roland Winkler <winkler <at> gnu.org>,  74307 <at> debbugs.gnu.org
> 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.


This bug report was last modified 262 days ago.

Previous Next


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