Just a random newbie emacs/opam/OCaml tip from my recent project setup travails re using multiple OPAM switches that I wish I could have googled:
I’ve used tuareg-opam-update-env to change between opam switches in emacs (I think this does everything necessary to select a different opam switch – at least nothing seems broken right now!)
From the command line I’m using this little wrapper script which I call inopam
Personally I picked up the habit from a colleague years ago of encoding needed context in my command line history (working directory, environment, etc.), which works well with prefix commands like this (and works even when you have variations that aren’t simply a function of current working directory).
Just out of curiosity: I notice that tuareg-opam-update-env doesn’t set OPAMROOT. I recall having to set that manually in emacs, though I don’t remember what didn’t work without it. Does anybody know why that emacs command doesn’t set it?