fix(linux): port startup and dictation fixes from the private working copy

Fixes that only existed on the Linux machine (unpushed commit and
uncommitted work there), without which a fresh clone breaks on Linux:

- config.el resolved coe-xx/mostalive/qwan against ~/.doom.d, but the
  config lives at ~/.config/doom, so (require 'coe-xx) aborted startup
  with "Cannot open load file". Resolve them against doom-user-dir.

- lisp/live-dictate.el only spoke whisper.cpp's POST /inference, which
  Lemonade (the Linux transcription server) does not serve -- every
  utterance came back as a not_found object and was dropped silently.
  It now auto-detects between /inference and the OpenAI-compatible
  /v1/audio/transcriptions endpoint, remembers which one answered,
  reports unusable replies, reads the VAD peak from the high byte of
  little-endian PCM16 (the low byte made silence look like speech),
  prints the peak level on stop, and gains M-x live-dictate-reload,
  wired into doom-after-reload-hook on both OSes.

- config.el hardcoded the macOS org-directory (~/MyDocuments, inside
  iCloud). Where the notes live is now owned by config-linux.el
  (~/Documents) and config-mac.el (~/MyDocuments), and the OS leaf
  loads before org and org-roam load below instead of after them.
  Blog export targets stay in the OS files, where they belong.

- mostalive/my-org-roam.el: compute org-agenda-files by listing the
  daily/ directory instead of org-roam-db-query at load time, and
  defer the full org-roam DB sync to idle time. Doom advises the first
  DB query of a session into a full org-roam-db-sync, which SHA1s all
  ~8.4k notes before the first frame is drawn (blank-screen startup).

Also correct the ~/.doom.d paths in AGENTS.md, the export-test header
and README that the sanitization base predated the fix for.
This commit is contained in:
Willem van den Ende
2026-11-27 17:57:37 +01:00
parent 1e08cff61c
commit 0b267d04c5
8 changed files with 399 additions and 101 deletions
+20 -17
View File
@@ -7,6 +7,15 @@
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Willem van den Ende")
;; Load the machine's own configuration first: config-mac.el and
;; config-linux.el own anything with a platform path, binary or backend --
;; including where the notes live (`org-directory'/`org-roam-directory'),
;; which has to be in place before org and org-roam load below.
;; config-local.el still loads last and wins over everything.
(pcase system-type
('darwin (load! "config-mac.el" doom-user-dir t))
('gnu/linux (load! "config-linux.el" doom-user-dir t)))
;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
;; are the three important ones:
;;
@@ -35,10 +44,10 @@
(setq org-superstar-headline-bullets-list '("⁖" "◉" "○" "✸" "✿"))
(setq org-startup-with-inline-images t)
;; org-roam customizations
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/MyDocuments/qwan/essays/willem")
(setq org-roam-directory "~/MyDocuments/qwan/essays/willem")
;; Where the notes live is machine-specific and is set by config-mac.el /
;; config-linux.el (config-local.el can override it). Set it there rather
;; than here: `org-default-notes-file' is computed from `org-directory' when
;; org loads, which happens below.
; (define-key org-roam-mode-map [mouse-1] #'org-roam-visit-thing)
;; `+roam` makes org-roam a module dependency, so this is normally a no-op.
@@ -301,26 +310,25 @@
;; craft of emacs
(add-load-path! "~/.doom.d/coe-xx")
;; Local packages live next to this file; resolve them against `doom-user-dir'
;; so the same config works on macOS (~/.config/doom) and Linux.
(add-load-path! (expand-file-name "coe-xx" doom-user-dir))
(require 'coe-xx)
(require 'coe-demo)
(add-load-path! "~/.doom.d/mostalive")
(add-load-path! (expand-file-name "mostalive" doom-user-dir))
(require 'my-org-roam)
(require 'journelly-convert-entry-to-org-roam)
(add-load-path! "~/.doom.d/qwan")
(add-load-path! (expand-file-name "qwan" doom-user-dir))
(require 'qwan-blog)
(require 'qwan-refactor)
(require 'qwan-dictation)
(require 'qwan-markdown-dnd)
(require 'org-roam-export-blog)
;; Blog export targets. Both paths are home-relative, so one setting works
;; on macOS (/Users/willem) and Linux (/home/willem). Override per machine
;; in config-mac.el / config-linux.el if a checkout lives elsewhere.
(setq org-roam-export-blog-firehose-root "~/dev/elixir/firehose"
org-roam-export-jekyll-root "~/MyDocuments/qwan/sites/qwaneu.github.io")
;; Blog export targets are machine-specific (config-mac.el / config-linux.el
;; own them) because the checkouts sit in different places per OS.
;; Toggle inline previews (images) of org links — SPC m l p in org buffers
(map! :after org
@@ -343,11 +351,6 @@
:init (defalias 'pi 'pi-coding-agent)
;; :custom pi-coding-agent-executable '("devcontainer" "exec" "pi"))
)
;; Load machine-specific configuration (gptel backends, etc.)
;; Each file only applies on its own platform.
(pcase system-type
('darwin (load! "config-mac.el" doom-user-dir t))
('gnu/linux (load! "config-linux.el" doom-user-dir t)))
;; org-roam v1 port to v2, insert node without opening buffer