Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "C. Fr" <newsgroups.fr@gmail.com>
To: <caml-list@yquem.inria.fr>
Subject: Configuring emacs to work with caml
Date: Sat, 16 Jan 2010 23:33:01 +0100	[thread overview]
Message-ID: <4b523e9c.0d67f10a.06ab.ffffced7@mx.google.com> (raw)

Hello everyone !

I’ve recently started coding in Caml, and I like it very much. I’m running
both Linux (Ubuntu) and windows, and on both systems I use emacs. However,
I’ve come into a few difficulties when configuring emacs under windows. More
specifically, I’ve been trying to create a portable setup of
camllight/ocaml, so as to run it from a USB stick.

My first step was to extract the contents of an Windows Caml package, to get
the binaries -- I couldn’t find anything but an installer, so I basically
copied the folders bin and lib to my USB. The files are organized in a tree
that looks like this :

--(USB Root)
-----(emacs files and folders)
-----\caml-bin
--------\camllight
-----------\bin
-----------\lib
--------\ocaml
-----------\bin
-----------\lib

Then, I installed the Caml mode for emacs by following that can be found
here : http://www.cs.jhu.edu/~scott/pl/caml/emacs.html

Of course, to make sure that my .emacs file could be found, I created the
following "site-start.el":

-- site-lisp\site-start.el --
(defvar program-dir (substring data-directory 0 -4))

(defvar caml-bin (concat program-dir "caml-bin"))
(defvar ocaml-bin (concat program-dir "caml-bin/ocaml/bin"))
(defvar ocaml-lib (concat program-dir "caml-bin/ocaml/lib"))
(defvar camllight-bin (concat program-dir "caml-bin/camllight/bin"))
(defvar camllight-lib (concat program-dir "caml-bin/camllight/lib"))

(setenv "HOME" program-dir)
(setenv "OCAMLLIB" ocaml-lib)
(setenv "CAMLLIB" camllight-lib)
(setenv "PATH" (concat (concat caml-bin ";") (getenv "PATH")))
(setenv "PATH" (concat (concat ocaml-bin ";") (getenv "PATH")))
(setenv "PATH" (concat (concat camllight-bin ";") (getenv "PATH")))
-- end of site-lisp\site-start.el --

Plus, I added to my .emacs file the following lines:

-- .emacs (USB drive root) --
(setq auto-mode-alist (cons '("\\.ml[iylp]?" . caml-mode) auto-mode-alist))
(autoload 'caml-mode "caml" "Major mode for editing Caml code." t)
(autoload 'run-caml "inf-caml" "Run an inferior Caml process." t)
(autoload 'camldebug "camldebug" "Run the Caml debugger." t)
-- end of .emacs --

Now, when I launch emacs, and use the built-in shell (M-!) to type ocaml or
caml, I get the regular caml prompt (adding CAMLLIB and OCAMLLIB solved a
few bugs), perfectly functional.
However, when I launch run-caml, and then type either "ocaml" or "caml" when
asked which toplevel to run ("Caml Toplevel to run:"), I invariably get the
message "Searching for program: no such file or directory, ocaml". However,
when I put the "ocaml.exe" file directly in emacs bin directory, the problem
vanishes.

Has someone ever encountered a similar problem? I just can't manage to find
a solution, and  would like to preserve my directory tree...
Thanks a lot for your support ! 



             reply	other threads:[~2010-01-16 22:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-16 22:33 C. Fr [this message]
2010-01-16 23:21 ` A syntax extension to simplify List manipulation Alexander Voinov
2010-01-17  8:24   ` [Caml-list] " blue storm
2010-01-25 17:42     ` Damien Doligez
2010-01-25 21:45       ` Alexander Voinov
2010-01-25 22:32         ` blue storm
2010-01-26  0:14           ` Alexander Voinov
2010-01-26  0:39             ` blue storm
2010-01-17  8:06 Configuring emacs to work with caml C. Fr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b523e9c.0d67f10a.06ab.ffffced7@mx.google.com \
    --to=newsgroups.fr@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox