Handoff note for the next session on the mac: what the three `unified` commits changed, why the shared/OS ownership now looks the way it does, the pull -> link-machine.sh -> doom sync -> restart sequence, static and runtime checks, the still-pending elixir server decision, and the shared defects not to trip over (pi-coding-agent, org paths, LaTeX fonts, duplicated blog roots). It also records what is intentionally absent on the mac: no STT (the whisper block is Linux-only, though the packages now install everywhere) and no configured eglot server for heex-ts-mode until the mac-side fix lands.
10 KiB
Agent start here: macOS after pulling unified
This is a handoff note for an agent working on the mac. The unified
branch merges the Linux machine's configuration into this repo. The Linux side
was just brought up to date; the mac has not yet pulled or run doom sync.
Read this before touching anything.
The mac checkout is assumed to be ~/.doom.d (adjust paths if not).
Ground rules
- Work on
unified. Do not switch tomaster, and do not push unless the human asks. - Never run
git clean. The rootinit.elis an untracked, gitignored symlink;git clean -xfddeletes it. Recreate it with./bin/link-machine.shif it disappears. - Never commit
init.el,custom.el,config-local.el, or*.elc; they are gitignored on purpose. config.elandpackages.elare shared with the Linux machine. Changes there affect both machines; preferconfig-mac.elfor mac-only work.config-linux.elis loaded only on Linux. Do not put mac settings there.- Do not "reconcile"
mac/init.elwithlinux/init.el. They differ on purpose (different module lists, e.g. ivy vs vertico,+lspflags). - Secrets and machine-local paths belong in
config-local.el(gitignored; seeconfig-local.example.el).
What each file owns
| File | Ownership |
|---|---|
config.el |
shared settings, loaded first |
packages.el |
shared package declarations |
config-linux.el |
loaded last on GNU/Linux only |
config-mac.el |
loaded last on macOS only |
linux/init.el, mac/init.el |
per-machine Doom module lists |
init.el |
untracked symlink into linux/ or mac/, made by bin/link-machine.sh |
config.el ends with the dispatch:
(pcase system-type
('darwin (load! "config-mac.el" doom-user-dir t))
('gnu/linux (load! "config-linux.el" doom-user-dir t)))
so the OS leaf always gets the last word.
What changed on unified (three commits)
9bff435 refactor(treesit): drop unused typescript grammars
0b3cf5b fix(elixir): let the OS files own eglot-server-programs
6df0d5b fix(packages): declare whisper and websocket
9bff435 — typescript grammars removed
The typescript/tsx entries in treesit-language-source-alist were nested
one list too deep, so lookups never matched them, and the dolist that
installed missing grammars errored out. Both entries and the installer are
gone; heex and elixir remain.
Consequence for the mac: existing compiled grammars keep working. But
mac/init.el enables (typescript +lsp) and (javascript +lsp +tree-sitter),
so if you work on TypeScript and the grammars are not installed, re-add this
(with correct nesting) plus the installer:
(treesit-language-source-alist
'((heex "https://github.com/phoenixframework/tree-sitter-heex")
(elixir "https://github.com/elixir-lang/tree-sitter-elixir")
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")))
(dolist (lang '(heex elixir typescript tsx))
(unless (treesit-language-available-p lang)
(treesit-install-language-grammar lang)))
0b3cf5b — eglot ownership moved to the OS files
The shared config.el used to set eglot-server-programs for
(elixir-mode elixir-ts-mode heex-ts-mode) to ("expert" "--stdio"). That
value leaked to Linux, where expert is not installed. It is deleted; each
OS leaf now owns the setting.
On the mac, config-mac.el still configures:
(add-to-list 'eglot-server-programs
'(elixir-ts-mode
. ("sh" "/Users/willem/.elixir-ls/release/language_server.sh")))
So elixir-ts-mode keeps working if that path exists. Note two things:
- The mac still needs the elixir-ls/expert cleanup the human mentioned (see "Pending mac work" below).
- The shared entry also covered
heex-ts-mode, whichconfig-mac.eldoes not.elixir-modeis moot becausemajor-mode-remap-alistmaps it toelixir-ts-mode, but.heexfiles currently get no configured server on the mac.
6df0d5b — whisper and websocket declared
packages.el now declares both. doom sync is required on the mac to
install them.
On the mac they are installed but unused: the use-package! whisper block and
the live-dictate autoload live in config-linux.el. There is no
speech-to-text on the mac yet. Porting it is a feature, not a copy: it needs
Lemonade (or another OpenAI-compatible STT backend), an ffmpeg audio device,
and its own config-mac.el block.
Startup checklist
Run these in order from the mac checkout.
-
Confirm branch and clean tree:
cd ~/.doom.d git branch --show-current # expect: unified git status --short # expect: empty (stash/save local edits first) -
Pull:
git fetch git pull --ff-only git log --oneline -3 # expect the three commits above -
Make sure the root symlink points at the mac entry file:
ls -l init.el # expect: init.el -> mac/init.el ./bin/link-machine.sh # only if missing or wrong; auto-detects DarwinNever commit the symlink.
bin/link-machine.shonly links files that exist inmac/, soconfig.el/packages.elstay at the root as intended. -
Sync packages (this is not optional;
packages.elchanged):doom syncWatch for straight.el errors while cloning
https://github.com/natrys/whisper.el. -
Restart Emacs (a full restart is safer than
M-x doom/reloadafter a sync).
Verification after startup
Static checks:
grep -n 'expert' config.el # expect: no output
grep -n 'expert' config-mac.el config-linux.el # only gptel prompts + Linux cond
emacs -Q --batch --eval '(dolist (f (list "config.el" "config-linux.el" "config-mac.el" "packages.el")) (with-current-buffer (find-file-noselect f) (goto-char (point-min)) (check-parens) (message "%s: OK" f)))'
Do not wrap the check-parens call in with-temp-buffer: that buffer is
in fundamental mode, so char literals such as ?\( and #' are misread and
you get false "unmatched bracket" errors. Use find-file-noselect as above.
Runtime checks in Emacs:
- Startup shows no error from the old typescript grammar installer.
(locate-library "websocket")and(locate-library "whisper")are non-nil.- Open an
.ex/.exsfile: it should useelixir-ts-mode, andM-x eglotshould offer the server fromconfig-mac.el. CheckM-: eglot-server-programsand confirm thelanguage_server.shpath. - Open a
.heexfile: expect no configured eglot server (known gap; see below). It should not crash. doom syncon the mac is also the only way to validate the package changes; nothing here was runtime-tested on the Linux side.
Pending mac work (not done by the Linux session)
Elixir language server
The mac path in config-mac.el is:
/Users/willem/.elixir-ls/release/language_server.sh
Check whether it exists and is executable before trusting it:
ls -l /Users/willem/.elixir-ls/release/language_server.sh
command -v expert
If expert is installed, the cleanest fix is to make config-mac.el mirror
the Linux logic (pick what exists; leave eglot alone otherwise) and cover all
three modes, not just elixir-ts-mode:
(with-eval-after-load 'eglot
(let ((server (cond ((executable-find "expert")
'("expert" "--stdio"))
((executable-find "language_server.sh")
(list (or (executable-find "bash") "sh")
(executable-find "language_server.sh"))))))
(when server
(setf (alist-get '(elixir-mode elixir-ts-mode heex-ts-mode)
eglot-server-programs
nil nil #'equal)
server))))
Commit that separately (e.g. fix(mac): configure the elixir server that actually exists) and say in the message that it was verified on the mac only.
Do not push unless asked. The mac no longer has expert forced on it by
shared config, so "nothing found" now means eglot stays at its default.
TypeScript grammars
Only if needed; see the corrected snippet under 9bff435.
Known shared defects (do not trip over them)
These exist on unified and affect both machines; they are out of scope
unless the human asks.
pi-coding-agentblock inconfig.elis half-edited. The:customline is commented out but its closing paren is not, leaving a stray), and:commands pifights:init (defalias 'pi 'pi-coding-agent).- Dead/commented leftovers in
config.el:linum-format(mode gone in Emacs 29; value also has a stray'), duplicatedisplay-line-numbers-typeandenable-local-variablessettings, commenteddoom-fontblock. - Duplicated blog roots:
org-roam-export-blog-firehose-rootandorg-roam-export-jekyll-rootare set in sharedconfig.eland in both leaves. Harmless (the leaf wins) but should be removed from the shared file. - Org paths are mac-shaped:
org-directoryandorg-roam-directoryare only set in sharedconfig.elto~/MyDocuments/.... That is correct on the mac but wrong on Linux, which has no override. If fixing, add the Linux values toconfig-linux.el; do not change the mac path. - LaTeX fonts are mac-only: the shared
org-latex-classesuses ETBembo RomanOSF, Raleway and Fira Code. Correct on the mac, missing on Linux, so Linux PDF export will fail until that block moves toconfig-mac.el. config-mac.el's eglot comment says the setting was "moved out of the shared config.el, where this macOS path was hard-coded". That is still historically true, but the shared file now configures no elixir server at all; update the comment if you touch that block.
When done
Report:
git log --oneline -3andgit status --short- what you changed, file by file, and why
- which checks you ran, and which things you could not verify (be explicit about runtime vs static checks)
- any further mac-only values still leaking from shared files
This file is committed as a handoff note. Once the mac is synced and the elixir-server work is done, delete it or rewrite it for the next machine.