【发布时间】:2015-12-10 02:42:15
【问题描述】:
我正在尝试编写 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" "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]$
(对于上下文,这是https://github.com/martinellison/oldrope 的一部分,但这与问题并不真正相关)。
【问题讨论】:
标签: emacs