大家好,我正在研究 Doom 的配置来自己从零攒一个配置。
但是在我读到常见的 file-name-handler-alist
设为 nil
的启动优化的时候产生了一个疑问:为何 Doom 要将在启动后恢复其值的函数 hook 到 emacs-startup-hook
而不是 after-init-hook
?
我看 Emacs 文档写到 emacs-startup-hook
是:
This normal hook is run, once, just after handling the command line arguments. In batch mode, Emacs does not run this hook.
另外鉴于 emacs-startup-hook
在整个 Doom 中只在该处出现,我只能推测 Doom 的作者有意希望 file-name-handler-alist
在 Batch Mode 中值为 nil
,但是我完全不理解为什么要这样做。
本质上我不理解在什么场景需要使用 emacs-startup-hook
,直觉上好像大部分情况都应该只使用 after-init-hook
?
感谢!