GNU bug report logs - #69714
30.0.50; ert-font-lock doesn't handle list of faces

Previous Next

Package: emacs;

Reported by: Troy Brown <brownts <at> troybrown.dev>

Date: Sun, 10 Mar 2024 20:33:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #40 received at 69714 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Vladimir Kazanov <vekazanov <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 69714 <at> debbugs.gnu.org
Subject: Re: bug#69714: [PATCH] Improve ert-font-lock assertion parser
Date: Mon, 1 Apr 2024 10:04:44 +0200
31 mars 2024 kl. 19.56 skrev Vladimir Kazanov <vekazanov <at> gmail.com>:

>    (rx "("
>        (* whitespace)
> -      (one-or-more
> -       (seq (regexp ert-font-lock--face-symbol-re)
> -            (* whitespace)))
> +      (opt (regexp ert-font-lock--face-symbol-re))
> +      (zero-or-more
> +       (seq (+ whitespace)
> +            (regexp ert-font-lock--face-symbol-re)))
> +      (* whitespace)
>        ")")

Since you want to match zero or more symbols, this can be improved further:

   (rx "("
       (* whitespace)
       (* (regexp ert-font-lock--face-symbol-re)
          (+ whitespace)))
       ")")

(Note that most rx operators have an implicit `seq` inside.)

You may want to use ´rx-define` instead of `defconst` as well -- it avoids some use of the `regexp` construct and removes some load-time string building.





This bug report was last modified 1 year and 50 days ago.

Previous Next


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