See also
Warning
This page is obsolete, look at Ilya Sergey’s installation page instead. Thank you.
The following sections briefly describe where and how to install Emacs on the most common systems. You should install Emacs version 2x, where x > 3. If your system is not listed here, you might find help on installing Emacs in the official Emacs documentation or that of your host system.
Windows users can use the official Windows binary. Download the zip-file and unpack it to your desired install location. No further installation should be necessary. More information on installation and setup can be found in the README file.
Try it out: Run bin/emacs.exe from the Emacs installation folder. Emacs should start and a window should open. To stop Emacs and close this window,
To install Emacs shortcuts in your menu run bin/addpm.exe.
OS X users can find a “vanilla” Emacs for OS X which is recommended here. Alternatively Carbon Emacs and Aquamacs are variants of Emacs customized specifically for OS X.
*nix users should use the package manager of their host system.
After installing Emacs, you should configure it by adding the following to your .emacs file which is your user configuration file for Emacs. To this end,
This maneuver will open up your .emacs file which is most likely empty. Paste the following code into the buffer by pressing Control + y:
(setq inhibit-startup-message t) ; dont show the GNU splash screen
(transient-mark-mode t) ; show selection from mark
(setq visible-bell 1) ; turn off bip warnings
(show-paren-mode t) ; turn on highlight paren mode
(fset 'yes-or-no-p 'y-or-n-p) ; use y and n for questions
(global-font-lock-mode t) ; enable syntax highlighting
(icomplete-mode 99) ; better buffer switching
Now save your .emacs file by
From now on, we will refer to the above sequence as C-x C-s, or in short C-x-s.
Assuming your user name on your Mac is your-user-name,
create the subdirectory /Users/your-user-name/.emacs.d/lisp,
put Steve Purcell’s file exec-path-from-shell.el as found on GitHub in your subdirectory /Users/your-user-name/.emacs.d/lisp, and
add the lines:
(setq load-path (cons "/Users/your-user-name/.emacs.d/lisp" load-path))
(require 'exec-path-from-shell)
(exec-path-from-shell-initialize)
in your .emacs file.
Doing this will let you start OCaml inside Emacs.
See the Tuareg repository on github.
To start OCaml inside Emacs run: M-x run-ocaml RET [1]. This should open a new window with an OCaml read-eval-print loop:
OCaml version 4.04.0
#
If you do not see the banner and the prompt above, there is an error in your installation.
If you see the banner and the prompt above, then type C-x 2 to split your screen horizontally into two windows, and then C-x b RET to get back to where you were. Type C-x o to switch windows, C-x 2 to split your current window horizontally into two, C-x 3 to split your current window vertically into two, and C-x 0 to close the current window.
The OCaml mode defines a numbre of useful features for programming in OCaml, as can be found through the help system with C-h m and of course through the Emacs tutorial (C-h t).
[1] | M refers the Alt-key and is pronounced meta. RET refers to the return key (a.k.a. the enter key). |