Function: tuareg--compile-opam
tuareg--compile-opam is a natively compiled function defined in
tuareg-opam.el.
Signature
(tuareg--compile-opam &rest _)
Documentation
Advice to update the OPAM environment to sync it with the OPAM switch before compiling.
Source Code
;; Defined in /nix/store/6mbh851dhnag8f92qfrlh9ckldzwf6c6-emacs-packages-deps/share/emacs/site-lisp/elpa/tuareg-20260626.936/tuareg-opam.el
;; OPAM compilation
(defun tuareg--compile-opam (&rest _)
"Advice to update the OPAM environment to sync it with the OPAM
switch before compiling."
(let* ((env (tuareg-opam-config-env)))
(when env
;; FIXME: This blindly overrides other settings the user
;; may have put into `compilation-environment'!
(setq-local compilation-environment
(mapcar (lambda(v) (concat (car v) "=" (cadr v)))
(tuareg-opam-config-env))))))