起因是来windows下看看有没有大佬编译的更好的版本, 还真找到一个 https://github.com/juanjosegarciaripoll/emacs-build
, 下来装doom 试试, 结果一安装
.\doom.cmd install
Eager macro-expansion failure: (void-variable )
Eager macro-expansion failure: (void-variable )
Error in Doom Emacs core: "cli/lib/lib.el", (void-variable )
这是宏展开的问题呀, 开启了--debug-init
也没有更多显示, 头秃. 好在搜到一位大神的解答: https://emacs.stackexchange.com/questions/54455/how-to-get-a-stack-trace-for-eager-macro-expansion-failure
.
逻辑是, 改造macroexp.el
中的internal-macroexpand-for-load
, 使得返回错误消息时带回更多参数.
我觉得好有道理, 马上开始改造:
(defun internal-macroexpand-for-load (form full-p)
...
;; (message "Eager macro-expansion failure: %S" err)
(message "Eager macro-expansion failure: %S form: %S load file: %S" err form load-file-name)
form)))))
然后我把这个函数依次放入init.el
, early-init.el
, 都没有什么变化, 还是缺乏信息.
于是, 我决定直接修改share\emacs\27.1\lisp\emacs-lisp\macroexp.el
, 并把macroexp.elc
macroexp.el.gz
, 都移走.
再来, 还是没有更多信息!!
我恶向胆边生, 都删光, 看你没有这个macroexp.el*怎么玩!!
燃鹅
emacs -Q
启动后, macroexpand-all
这个函数照常可以运行 ,
我C-h f
查找帮助文档, 得到的是:
macroexpand-all is a compiled Lisp function.
(macroexpand-all FORM &optional ENVIRONMENT)
Probably introduced at or before Emacs version 22.1.
Return result of expanding macros at all levels in FORM.
If no macros are expanded, FORM is returned unchanged.
The second optional arg ENVIRONMENT specifies an environment of macro
definitions to shadow the loaded ones for use in file byte-compilation.
不再显示源文件了, 可还照常能用, internal-macroexpand-for-load
也是如此,这是什么原理??
我再三确认了, emacs目录没macroexp.*
文件, 而系统PATH
上也没有别的emacs版本了.
我把macroexp.*
都删掉,那它是在哪里加载到函数macroexpand-all
的呢? 我在init.el重定义又为什么不起作用呢?
头秃, 求大神指导!!