PG icon indicating copy to clipboard operation
PG copied to clipboard

Per-project switch selection

Open Lysxia opened this issue 4 years ago • 2 comments

Right now when I switch between projects using different Coq versions I have to remember to first do an opam switch. Can we tell PG which switch to use on startup, e.g., with a configuration file at the root of each project?

This is related to #210 but I'm asking about a non-interactive feature.

Lysxia avatar Apr 16 '20 13:04 Lysxia

Hi @Lysxia, thanks for opening this! I was precisely planning to work on #210 in the next weeks as this interactive feature is definitely missing (basically we need to do opam switch and restart emacs currently :-/), but the feature you suggest would be an interesting non-interactive counterpart indeed!

just to refine your suggestion, it seems it would suffice (when implementing #210) to add a option and set it as a file-local-variable, or in a .dir-locals.el file (emacs' standard conf-file) in the project's root.

erikmd avatar Apr 17 '20 19:04 erikmd

One thing that would be great to incorporate this with is opam switch link

Turns out you can have opam automatically switch based on the directory that you're working in!

https://opam.ocaml.org/doc/man/opam-switch.html

Proof general doesn't seem to handle this automatically, though. As far as I can tell this adjusts the OPAM_SWITCH_PREFIX environment variable based on the directory that you're in, but this doesn't happen just by switching emacs buffers.

Chobbes avatar Apr 25 '20 00:04 Chobbes