Emacs regexp and syntax highlighting
Pregunta
I want to highlight some words (ex. "true", "false"), but only when they are between the tags <?=
and ?>
.
In the example below I only want to highlight the second "true" keyword:
<input checked="true"><?=($i === true ? $foo : $bar)?>
Is there any special font-locking mode for this kind of situation?
Solución
Font lock can call functions too in addition to matching regexps:
Find text by calling function, and highlight the matches it finds using font-lock-keyword-face.
http://www.gnu.org/s/emacs/manual/html_node/elisp/Search_002dbased-Fontification.html
Only you need to know Elisp.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow