[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some parts of font locking in my new major mode works only after mod
From: |
Stefan Monnier |
Subject: |
Re: Some parts of font locking in my new major mode works only after modifying the buffer |
Date: |
Sun, 25 Aug 2013 09:46:25 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> 1 <editword> <n> Words = {Esc} $2 $1;
> 2
> 3 ### Lines
> 4
> 5 New Line = {Enter};
> 6 Newline Indent = {Ctrl+j};
[...]
> '(("^\\([^=]+\\)=" 1 font-lock-variable-name-face)
This regexp will match (on the first call) "<editword> <n> Words =" on
the first call. And on the second it will match:
" {Esc} $2 $1;
### Lines
New Line ="
This text includes parts that are already highlighted (the "### Lines"
comment), so font-lock doesn't apply the text-property. You can force
it to apply the text property (using the OVERRIDE part of the rule, see
C-h v font-lock-keywords), but I doubt that's what you want anyway,
Stefan