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

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 17 Nov 2024 06:23:02 +0000

Your bug report

#68318: 30.0.50; Fontification of \{m\} and \{m,n\} in a 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].

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

Subject: Re: bug#74308: 30.0.92; emacs-lisp font-locking word regexp
From: Eli Zaretskii <[email-masked]>
To: Arash Esbati <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Sun, 17 Nov 2024 08:22:23 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Arash Esbati <[email-masked]>
> Cc: Roland Winkler <[email-masked]>,  [email-masked]
> Date: Sat, 16 Nov 2024 22:33:55 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > merge 74308 74307
> > thanks
> >
> >> From: Roland Winkler <[email-masked]>
> >> Date: Mon, 11 Nov 2024 00:30:46 -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.
> >
> > This is an exact duplicate of bug#74307 that you submitted just 2
> > minutes earlier, so I'm merging them.
> 
> I think bug#68318 is also about the same issue; it can be merged into
> this one as well.

Thanks.  Since this bug was already closed, I'm therefore closing
bug#68318 as well.

Subject: 30.0.50; Fontification of \{m\} and \{m,n\} in a regexp
From: Arash Esbati <[email-masked]>
To: "emacs-bugs" <[email-masked]>
Date: Mon, 08 Jan 2024 10:26:16 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi all,

to reproduce, start 'emacs -Q' and paste the following lines into
scratch:

(re-search-forward "a\\{7\\}")

(re-search-forward "a\\{7,\\}")

(re-search-forward "a\\{,7\\}")

For me, it looks like this:

Hitting 'C-u C-x =' on the first 7 and the backslashes says:

  There are text properties here:
    face                 (font-lock-variable-name-face font-lock-string-face)
    fontified            t

On the next two forms, I get:

  There are text properties here:
    face                 font-lock-string-face
    fontified            t

Is this difference on purpose?

Best, Arash

In GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin23.2.0, NS
 appkit-2487.30 Version 14.2.1 (Build 23C71)) of 2024-01-07 built on
 MacMutant.fritz.box
Repository revision: f866c85ac4e32df8061b285b6b44b15346994f3d
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.2.1

Configured using:
 'configure --with-ns --without-pop --without-mailutils --with-threads
 --with-modules --with-native-compilation --without-compress-install
 'CFLAGS=-O2 -g0 -pipe'
 'CPPFLAGS=-I/opt/homebrew/Cellar/gcc/13.2.0/include
 -I/opt/homebrew/Cellar/libgccjit/13.2.0/include
 -I/opt/homebrew/Cellar/gmp/6.3.0/include'
 'LDFLAGS=-L/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current
 -L/opt/homebrew/Cellar/gmp/6.3.0/lib''

Configured features:
ACL GLIB GMP GNUTLS JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE
NS PDUMPER PNG RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER WEBP
XIM ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix