看其他人写得use-package
配置都是关于一些minor-mode
的
我不知道能不能加载其他一些.el
文件
作死尝试了一下
(require 'math)
(use-package math-mode
:mode "\\.math\\'"
;; :load-path "~/.emacs.d/packages/math.el"
:init (message "hello world"))
我已经配置过load-path
了,这是我的math.el
(setq math/highlights
'(("Sin\\|Cos\\|Sum" . font-lock-function-name-face)
("Pi\\|Infinity" . font-lock-constant-face)))
(define-derived-mode math-mode fundamental-mode "math"
"major mode for editing math code."
(setq font-lock-defaults '(math/highlights)))
(provide 'math)
打开一个.math
文件,发现
File mode specification error: (error Autoloading file /home/steiner/.emacs.d/packages/math.el failed to define function math)
这是怎么回事?我的写法哪里有误吗?我该怎么写