GNU bug report logs - #5373
Example in font-lock-add-keywords should use shy subgroup

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Wed, 13 Jan 2010 10:27:01 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 5373 <at> debbugs.gnu.org
Subject: bug#5373: Example in font-lock-add-keywords should use shy subgroup
Date: Wed, 13 Jan 2010 10:18:08 -0500
> Should not the second regexp in

>  (font-lock-add-keywords 'c-mode
>   '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
>     ("\\<\\(and\\|or\\|not\\)\\>" . font-lock-keyword-face)))

> use a shy subgroup like in

>  (font-lock-add-keywords 'c-mode
>   '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
>     ("\\<\\(?:and\\|or\\|not\\)\\>" . font-lock-keyword-face)))

It could.  But the use of a normal group is harmless.


        Stefan




This bug report was last modified 15 years and 211 days ago.

Previous Next


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