Function: tuareg-opam-config-env
tuareg-opam-config-env is a natively compiled function defined in
tuareg-opam.el.
Signature
(tuareg-opam-config-env &optional SWITCH)
Documentation
Get the opam environment for the given switch (or the default
switch if none is provied) and return a list of lists of the
form (n v) where n is the name of the environment variable and v
its value (both being strings). If opam is not found or the
switch is not installed, nil is returned.
Source Code
;; Defined in /nix/store/6mbh851dhnag8f92qfrlh9ckldzwf6c6-emacs-packages-deps/share/emacs/site-lisp/elpa/tuareg-20260626.936/tuareg-opam.el
(defun tuareg-opam-config-env (&optional switch)
"Get the opam environment for the given switch (or the default
switch if none is provied) and return a list of lists of the
form (n v) where n is the name of the environment variable and v
its value (both being strings). If opam is not found or the
switch is not installed, `nil' is returned."
(let* ((switch (if switch (concat " --switch " switch)))
(get-env (concat tuareg-opam " env --sexp" switch))
(opam-env (tuareg--shell-command-to-string get-env)))
(if opam-env
(car (read-from-string opam-env)))))