我试着写defface
(defface ne-keyword-face
'((t :foreground "blue"
;; :background "aquamarine"
:weight bold
:underline t
))
"Face for keyword"
:group 'ne-mode)
我的major
mode编写
(define-derived-mode ne-mode fundamental-mode "ne mode"
(setq-local ne-highlights
'(
;; keywords
;; ("#.* " . font-lock-keyword-face)
("#.*" . ne-keyword-face)
("\\<return\\>" . font-lock-keyword-face)
;; type
("\\<int\\>" . font-lock-type-face)
;; function PROBLEM here
("\\w+\(.*\);?" . font-lock-function-name-face)
;; single line comment
("/\*.*\*/" . font-lock-comment-face)))
;; multi line comment
(setq font-lock-defaults '(ne-highlights)))
这是在测试文件的结果
很可惜,没什么用
把ne-keyword-face
那一行拿掉的样子
这个defface
到底该怎么用??
ps: 哪个:group
是干啥用的,能吃吗