macOS 安装 Emacs
Emacs Plus
$ brew tap d12frosted/emacs-plus
$ brew install emacs-plus@31 --with-native-comp
安装后显示:
Emacs.app was installed to:
/opt/homebrew/opt/emacs-plus@31
To link the application to default Homebrew App location:
osascript -e 'tell application "Finder" to make alias file to posix file "/opt/homebrew/opt/emacs-plus@31/Emacs.app" at posix file "/Applications" with properties {name:"Emacs.app"}'
Your PATH value was injected into Emacs.app/Contents/Info.plist
Report any issues to https://github.com/d12frosted/homebrew-emacs-plus
To start d12frosted/emacs-plus/emacs-plus@31 now and restart at login:
brew services start d12frosted/emacs-plus/emacs-plus@31
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/emacs-plus@31/bin/emacs --fg-daemon
将 Emacs 应用程序创建到 /Applications
文件夹
如果你希望在应用程序文件夹中方便地访问 Emacs,执行以下命令创建快捷方式:
osascript -e 'tell application "Finder" to make alias file to posix file "/opt/homebrew/opt/emacs-plus@31/Emacs.app" at posix file "/Applications" with properties {name:"Emacs.app"}'
这将把 Emacs 应用程序的快捷方式放入 /Applications
文件夹,方便通过 Finder 或 Launchpad 启动。
native-comp
使用命令行版本打开是可以的,从 Launcher 中打开会报如下错误:
libgccjit.so: error: error invoking gcc driver
[常规]:调用 gcc 驱动程序时出现 libgccjit.so 错误 ·问题 #733 ·d12frosted/自制 emacs-plus --- [General]: libgccjit.so error invoking gcc driver · Issue #733 · d12frosted/homebrew-emacs-plus
启动 Emacs 服务(可选)
如果你希望在后台启动 Emacs 并让它在系统重启时自动启动,可以使用以下命令:
brew services start d12frosted/emacs-plus@29
这会将 Emacs 启动为后台服务,并在每次重启时自动启动。
手动启动 Emacs(无后台服务)
如果你不需要后台服务,而是只想启动一个常规的 Emacs 会话,可以执行:
/opt/homebrew/opt/emacs-plus@29/bin/emacs --fg-daemon
这将启动一个前台进程的 Emacs 实例,并允许你继续使用终端。
网络资源
- d12frosted/homebrew-emacs-plus: Emacs Plus formulae for the Homebrew package manager
- native compile 対応の Emacs を Mac へ install する #Native - Qiita
- Software linked against libgccjit no longer works after upgrade to 14.1.0 · Homebrew · Discussion #5364
- [Build Failure]: Installation fails with --with-native-comp: The installed libgccjit failed to compile and run · Issue #684 · d12frosted/homebrew-emacs-plus
本文作者:Maeiee
本文链接:macOS 安装 Emacs
版权声明:如无特别声明,本文即为原创文章,版权归 Maeiee 所有,未经允许不得转载!
喜欢我文章的朋友请随缘打赏,鼓励我创作更多更好的作品!