Set emacs mode and set default font lock

I am writing a small mode for HTML / PHP templates.

I have var with php keywords

(defvar web-mode-php-keywords
 '("array" "as" "break" "catch" "continue")
  "PHP keywords.")

This var is used to lock the font as follows:

(defvar web-mode-php-font-lock-keywords
 (list
  (cons (concat "\\<\\(" (regexp-opt web-mode-php-keywords) "\\)\\>") 'web-mode-keyword-face)
...

I can’t find a way to add the user to the list web-mode-php-keywordsin his.emacs

web-mode-php-font-lock-keywordsrelies on web-mode-php-keywordsand trying to change web-mode-php-keywordsthe hook does not work because it is web-mode-php-font-lock-keywordsalready built

I think I missed something ... (is this related to eval-after-load?)

+3
source share
1 answer

I think you could do it (setq web-mode-php-keywords '("array" "as" "break" "catch" "continue" "mykeyword1" "mykeyword2"...))before downloading the web mode file.

+2
source

All Articles