Author: Ralf Treinen <treinen@debian.org>
Description: set tuareg-interactive-program to opam only when opam is
  installed, and the user has an .opam directory
Debian-bug: #88456

Index: tuareg-mode/tuareg.el
===================================================================
--- tuareg-mode.orig/tuareg.el	2016-07-16 20:36:23.576386723 +0200
+++ tuareg-mode/tuareg.el	2016-07-16 20:39:43.441323983 +0200
@@ -2378,7 +2378,11 @@
         (if (and opam (file-executable-p opam)) opam)))) ; or nil
   "The full path of the opam executable.")
 
-(when tuareg-opam
+(defvar tuareg-configured
+  (if (file-directory-p "~/.opam") t nil)
+  "Flag indicating presence of ~/.opam")
+
+(when (and tuareg-opam tuareg-configured)
   (setq tuareg-interactive-program
         (concat tuareg-opam " config exec -- ocaml"))
 
