我的Emacs模式不突出显示关键字
我试图写一个Emacs主修模式,但它不起作用;具体来说,我的关键字不会显示在关键字字体中。我试着按照教程做,但一定是做错了什么。我懂一点Lisp,但不懂Emacs脚本 我的Emacs模式脚本:我的Emacs模式不突出显示关键字,emacs,Emacs,我试图写一个Emacs主修模式,但它不起作用;具体来说,我的关键字不会显示在关键字字体中。我试着按照教程做,但一定是做错了什么。我懂一点Lisp,但不懂Emacs脚本 我的Emacs模式脚本: ;; emacs mode for OldRope ;; does no work for some reason (setq oldrope-directive-keywords-regexp (regexp-opt '("page" "link" "goto" "act" "end" "div" "
;; emacs mode for OldRope
;; does no work for some reason
(setq oldrope-directive-keywords-regexp (regexp-opt '("page" "link" "goto" "act" "end" "div" "span" "include")))
(defvar oldrope-font-lock-defaults '((
(oldrope-directive-keywords-regexp . font-lock-keyword-face))))
(define-derived-mode oldrope-mode fundamental-mode
"oldrope mode"
"Major mode for editing OldRope games"
(setq comment-start "/*")
(setq comment-end "*/")
(setq font-lock-defaults oldrope-font-lock-defaults))
(provide 'oldrope-mode)
测试文件:
$[page start]$ Hello $[link]$ Click me $[act]$ That is right. $[end]$
(就上下文而言,这是问题的一部分,但与问题无关)。您需要这个-其余的都可以:
(defvar OLDROWE字体锁定默认值
`((,oldrowe指令关键字regexp.font-lock关键字face)))
通过简单地引用列表,您并不是在评估oldrop指令关键字regexp
——您引用的列表只是将该符号作为它的汽车
使用反引号(`
)加逗号(,
)或(list(list(list(cons-oldrowe-directive-keywords-regexp'font-lock-keyword-face))
计算该变量并在结果列表中使用其值