3
我正在为HTML/PHP模板写一个次要模式。定制emacs模式和字体锁定默认值
我有PHP关键字VAR
(defvar web-mode-php-keywords
'("array" "as" "break" "catch" "continue")
"PHP keywords.")
该变种用于字体锁定这样的:
(defvar web-mode-php-font-lock-keywords
(list
(cons (concat "\\<\\(" (regexp-opt web-mode-php-keywords) "\\)\\>") 'web-mode-keyword-face)
...
我不设法找到一种方法,让用户添加关键字到web-mode-php-keywords
名单在他.emacs
web-mode-php-font-lock-keywords
依靠web-mode-php-keywords
,并试图改变web-mode-php-keywords
在呼k没有工作,因为web-mode-php-font-lock-keywords
已经内置
我想我错过了什么... (这是关系到eval-after-load
?)
我不想让用户添加没有设置所有关键字列表的关键字。我这样做:'(defconst web-mode-php-constants (eval-when-compile (regexp-opt (append(if(boundp'web-mode-php-constants)web-mode-php- ()“) ”PHP常量。“).... ....但也许存在一个更好的解决方案 – fxbois