关于启动时间,Mac下有很奇怪的现象。

在 Mac 下用 mac-port 启动速度明显比 普通的快(spacemacs)

因为黑科技。 你可以在 Mac Port 项目主页看看它改了哪些功能。

比如它支持动画效果。自动获得终端环境变量。更深层次的系统交互。

还有,如果你用的是机械硬盘,启动时间在更新/重新安装之后会有波动是正常的。

1 个赞

我没用 Spacemacs,用的是自己的配置,没发现有你说的现象,我这里差不多,都是两三秒钟。

也可能跟你使用的配置有关,比如 Mac Port 可能用不上 exec-path-from-shell,像这样一段配置

(when (eq window-system 'ns)
  (require 'exec-path-from-shell)
  (exec-path-from-shell-initialize))

就会让官方的比 Mac Port 启动要慢上一些(比如一秒钟),可能是因为:

  • Mac Port 读取环境变量比 exec-path-from-shell 快 (C 比 Lisp 快)
  • Mac Port 默认用的是 login Shell,而 exec-path-from-shell 默认是 login + interactive shell,自然会快(而且很有可能快上非常多)

Mac port可以不用exec-path-from-shell了?

BTW: 法二可以自己设置,M-x customize-group, exec-path-from-shell ->'(exec-path-from-shell-arguments (quote ("-l"))).

因为它自身就会继承环境变量

Linux 25.2的Emacs去掉了exec-path-from-shell也有系统的环境变量了。不知道做了什么调整。。