简单自定义了两个 minor-mode,同样的套路,第一个 vex-mode 实现了语法高亮并可以用 company + backends 补全。
;;;
;;; dec hook
;;;
(defvar blove-vex-mode-hook nil)
;;;
;;;###autoload
(define-derived-mode blove-vex-mode c-mode "vex"
"Major mode for editing houdini vex."
(setq font-lock-defaults '((vex-font-lock-keywords)))
)
(add-to-list 'auto-mode-alist '("\\.vfl\\'" . blove-vex-mode))
;; run-hook
(run-hooks 'blove-vex-mode-hook)
;; add the mode to the `features' list
(setq major-mode 'blove-vex-mode)
(provide 'blove-vex-mode)
;;;
;;; blove-vex-mode.el ends here
;;;
下面的自定义 minor-mode 不成功。主要问题是语法不高亮,并且 python 补全也失效。
;;;
;;; dec hook
;;;
(defvar blove-hython-mode-hook nil)
;;;
;;;###autoload
(define-derived-mode blove-hython-mode python-mode "hython"
"Major mode for editing houdini python."
(setq font-lock-defaults '((hython-font-lock-keywords)))
)
(add-to-list 'auto-mode-alist '("\\.py\\'" . blove-hython-mode))
;; run-hook
(run-hooks 'blove-hython-mode-hook)
;; add the mode to the `features' list
(setq major-mode 'blove-python-mode)
(provide 'blove-hython-mode)
;;;
;;; blove-hython-mode.el ends here
;;;
请问,第二个自定义 minor-mode 应该如何修改?