aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorVaino Kauppila <vaino@vke.fi>2026-09-10 14:58:07 +0300
committerVaino Kauppila <vaino@vke.fi>2026-09-10 14:58:07 +0300
commite459fea00e71717df0ece58989986c641c4a2ff2 (patch)
treeddc50b1daaf226f38df4ff9707fb3e94bc30ae79 /README.md
parente1b2af4e400ecae38fc8890879b91515ba3c2451 (diff)
downloademacs_setup-e459fea00e71717df0ece58989986c641c4a2ff2.tar.gz
emacs_setup-e459fea00e71717df0ece58989986c641c4a2ff2.zip
Python LSP via per-project micromamba envs; silence native-comp warnings
- Drop python-mode from the global eglot hook: mode hooks run before .dir-locals.el applies, so it would always grab the system pylsp. Python eglot now starts per-project from .dir-locals.el pointing at the project's micromamba env (interpreter, exec-path, pylsp). - templates/python-project-dir-locals.el: copy+edit recipe for new projects. vkeHF is already wired to env vkehf. - Suppress (native-compiler) warnings: go-mode and friends reference lsp/eglot functions they don't require; harmless noise. Verified in a GUI session: opening vkeHF/superhet.py connects eglot and spawns ~/.local/share/mamba/envs/vkehf/bin/pylsp.
Diffstat (limited to 'README.md')
-rw-r--r--README.md31
1 files changed, 29 insertions, 2 deletions
diff --git a/README.md b/README.md
index 8b2718a..0f34329 100644
--- a/README.md
+++ b/README.md
@@ -43,12 +43,39 @@ Fixed in a follow-up commit:
and hooks `lsp` into `verilog-mode`, but the binary is not installed, so
opening Verilog files errored. Now registered only when the binary exists
(`executable-find`). Install `verible` to re-enable.
+3. **Harmless native-comp warnings** — packages like go-mode reference
+ lsp-mode/eglot functions they don't require; the resulting
+ `(native-compiler)` warnings cluttered *Warnings*. Now suppressed
+ (`warning-suppress-types`, after the custom block).
+
+## Python: per-project micromamba environments
+
+Python LSP is deliberately NOT enabled globally (see the comment on the
+eglot `use-package` form): mode hooks run before `.dir-locals.el` applies,
+so a global hook would always connect to the system pylsp. Instead each
+micromamba project carries a `.dir-locals.el` that points the interpreter,
+`exec-path` and eglot at the env, then starts eglot.
+
+New project setup:
+
+```sh
+micromamba create -n ENVNAME -c conda-forge python=3.12 python-lsp-server <libs>
+cp templates/python-project-dir-locals.el <project>/.dir-locals.el # edit env path
+```
+
+First time you open a file in the project, Emacs asks to trust the `eval`
+forms — answer `!` (trust always).
+
+`~/Projects/vkeHF` is set up this way with env `vkehf`
+(numpy, control, matplotlib, python-lsp-server); verified that eglot spawns
+`~/.local/share/mamba/envs/vkehf/bin/pylsp`.
Known quirks left as-is (deliberate-looking choices — revisit if annoying):
- **`lsp-mode` and `eglot` are both active**: lsp-mode owns C/C++/Verilog/VHDL/
- LaTeX, eglot owns Java/Scala/Python/Clojure. The C/C++ overlap is noted in
- the config itself. Works, but pick one eventually.
+ LaTeX, eglot owns Java/Scala/Clojure (Python is per-project, see above).
+ The C/C++ overlap is noted in the config itself. Works, but pick one
+ eventually.
- **`jdtls` is not installed**, so Java files will fail to start eglot.
Install `jdtls` (or drop java-mode from the eglot hook).
- **`flycheck-c/c++-gcc-executable` is set to `/usr/bin/avr-gcc`** in