# emacs
- [readline emacs editing mode cheat sheet](x-devonthink-item://E5F9BA15-EE84-4C51-9DE6-8270EA8D20B0)
## [[MacOS]]
```bash
# You may or may not have to reinstall (instead of install)
# if you recently upgraded your MacOS major version and have these packages installed already
brew install texinfo tree-sitter libgccjit
# as of [[2025-06-16]], railwaycat only builds 29.1
# install and build emacs with native compilation, an Emacs.app et al
# brew tap railwaycat/emacsmacport
# brew install emacs-mac --with-modules --with-starter --with-dbus --with-glib --with-imagemagick --with-mac-metal --with-native-comp --with-librsvg
# osa script so spotlight/raycast have an entry to launch emacs
#osacompile -o /Applications/Emacs.app -e "tell application \"Finder\" to open POSIX file \"$(brew --prefix)/opt/emacs-mac/Emacs.app\""
# Manual build and install for 31+ (native comp is default now)
git clone https://github.com/jdtsmith/emacs-mac.git
cd emacs-mac
git checkout emacs-mac-gnu_master_exp
./autogen.sh
CFLAGS="-O3 -mcpu=native" ./configure --with-native-compilation --with-tree-sitter --enable-mac-app=yes --enable-mac-self-contained --with-modules --with-dbus --with-imagemagick --with-mac-metal
make -j6
make install
EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs doom sync
```
> [!note] emacs with native compilation
> Emacs attempts to compile uncompiled modules on launch, so you will want to launch and let it run for a bit. You can follow along by watching the `*Async-native-compile-log*` buffer.