The shared config.el hard-coded ("expert" "--stdio"), a mac-flavoured value
from upstream c83209e, so it leaked into the Linux machine, where neither
`expert' nor language_server.sh is installed and eglot was therefore
configured with a program that cannot start.
c2f24ba claimed the Linux fallback fixed this, but it only overrides *when
it finds a server*: with nothing installed the broken shared value survived.
The correction is to remove the shared setting entirely. config-mac.el
already configures the mac's elixir-ls, and config-linux.el's cond now means
"nothing found" leaves eglot at Emacs' default instead of pointing at a
missing binary.
config-linux.el's header comment said the shared file "used to point eglot
at a macOS path"; reword it to state that the shared file does not configure
the server at all, and why.
72 lines
3.5 KiB
EmacsLisp
72 lines
3.5 KiB
EmacsLisp
;;; config-linux.el --- Linux-specific configuration -*- lexical-binding: t; -*-
|
|
|
|
;; Loaded from config.el on GNU/Linux machines only; config-mac.el is the
|
|
;; macOS counterpart. Anything with a Linux path, a Linux binary, or a
|
|
;; backend that only exists on this box belongs here rather than in the
|
|
;; shared config.el.
|
|
;;
|
|
;; Machine-specific settings that should not be committed at all (API keys,
|
|
;; checkouts in unusual places) belong in config-local.el, which is
|
|
;; gitignored -- see config-local.example.el.
|
|
|
|
;; Elixir language server. The shared config.el deliberately does not
|
|
;; configure this: a single value cannot be right on both machines, and
|
|
;; pointing eglot at a binary that may not exist is worse than leaving it at
|
|
;; Emacs' default. So each OS file owns it. Here: prefer `expert' if it is
|
|
;; installed, else any elixir-ls on PATH, else leave eglot alone rather than
|
|
;; configuring a server that cannot start.
|
|
(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))))
|
|
|
|
;; Blog export destinations. Upstream keeps these in the shared config.el as
|
|
;; ~/MyDocuments/..., which does not exist on this machine; here the jekyll
|
|
;; checkout lives under ~/Documents/.... Both are home-relative, so if a
|
|
;; checkout ever moves, override it in config-local.el.
|
|
(setq org-roam-export-blog-firehose-root "~/dev/elixir/firehose"
|
|
org-roam-export-jekyll-root "~/Documents/qwan/sites/qwaneu.github.io")
|
|
|
|
;;; Speech-to-text (whisper.el + streaming dictation)
|
|
;;
|
|
;; Linux only for now: this needs whisper.el installed, a Lemonade server
|
|
;; listening on :13305, and an ffmpeg that can capture from PulseAudio. On
|
|
;; macOS none of that is set up yet, so the whole block lives here rather
|
|
;; than in the shared config.el. Porting it is a feature, not a move: pick
|
|
;; an audio input (see `live-dictate-ffmpeg-input-format'/`-device'), install
|
|
;; `whisper' via packages.el, and point `live-dictate-server-url' at a
|
|
;; reachable backend.
|
|
;;
|
|
;; Note: `whisper' must also be declared in packages.el for these autoloads
|
|
;; to exist on a fresh install.
|
|
(add-load-path! "lisp")
|
|
(autoload #'live-dictate "live-dictate" nil t)
|
|
|
|
(use-package! whisper
|
|
:commands (whisper-run whisper-file whisper-select-language)
|
|
:init
|
|
(map! :leader
|
|
(:prefix ("A" . "+ai")
|
|
:desc "Whisper record/transcribe" "w" #'whisper-run
|
|
:desc "Whisper transcribe file" "W" #'whisper-file
|
|
:desc "Whisper select language" "l" #'whisper-select-language
|
|
:desc "Live dictate (streaming)" "d" #'live-dictate))
|
|
:config
|
|
(setopt whisper-install-whispercpp nil ; no whisper.cpp needed, remote API only
|
|
whisper-server-mode 'openai ; use OpenAI-compatible transcription API
|
|
whisper-openai-api-baseurl "http://localhost:13305/"
|
|
whisper-openai-api-key "not-needed" ; Lemonade ignores auth, but whisper.el requires a non-nil key
|
|
whisper-openai-model "Whisper-Large-v3-Turbo"
|
|
whisper-language "en"
|
|
whisper-translate nil ; t would POST to /translations instead
|
|
whisper-return-cursor 'end))
|
|
|
|
;;; config-linux.el ends here
|