# Emacs Setup Files

These are the public Emacs setup files served by HAIDOX.

Server layout:

- Test/source tree: `<project-root>/haidox_root/portal/public_files/emacs/`
- Deployed tree: `<deploy-root>/portal/public_files/emacs/`
- Public URL prefix: `/portal/files/emacs/`

The test server and deployed server must serve the same four files from the same
relative app path. Edit the files in `portal/public_files/emacs/` in the source
tree, then deploy so the deployed tree receives the same files.

Files:

- `README.md`: this file
- `emacs-modern-init.el`: public starter `init.el` example
- `install-emacs.py`: installer/checker implementation
- `install-emacs.sh`: thin shell wrapper

User download flow:

```bash
mkdir -p emacs-setup
cd emacs-setup
HAIDOX_SITE="https://example.com"
curl -fLO "$HAIDOX_SITE/portal/files/emacs/README.md"
curl -fLO "$HAIDOX_SITE/portal/files/emacs/emacs-modern-init.el"
curl -fLO "$HAIDOX_SITE/portal/files/emacs/install-emacs.py"
curl -fLO "$HAIDOX_SITE/portal/files/emacs/install-emacs.sh"
chmod +x install-emacs.sh
```

Safe first run:

```bash
./install-emacs.sh --check
```

Apply the setup:

```bash
./install-emacs.sh --apply
```

Apply the setup and create an editor Python venv for `basedpyright` and `ruff`:

```bash
./install-emacs.sh --apply --setup-python-venv
```

The default mode does not change files. Use `--apply` to install packages or write
`~/.emacs.d/init.el`.
