A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ocaml/tuareg below:

GitHub - ocaml/tuareg: Emacs OCaml mode

Tuareg: an Emacs OCaml mode

This archive contains files to help editing OCaml code, to highlight important parts of the code, to run an OCaml REPL (also called toplevel), and to run the OCaml debugger within Emacs.

The easier way to install Tuareg is though the Emacs package system with NonGNU ELPA or MELPA (configuration).

You can also install it using OPAM:

and follow the instructions given at the end of the opam installation.

If you want to install from the Git checkout, just add to your Init File the line:

(load "path-to-git-checkout-dir/tuareg-site-file")

If you want to byte compile the files, issue make elc. If you do this in Darwin, make sure that the version of Emacs displayed at the end of make elc is the sole that you use (the .elc files may not be compatible with other versions of Emacs installed on your system).

The Tuareg major mode is triggered by visiting a file with extension .ml, .mli, and .mlp or manually by M-x tuareg-mode. A Menhir mode, tuareg-menhir, supports .mly files. (A special mode for .mll has yet to be written.)

For the convenience of users of ocsigen, the extensions .eliom, .eliomi trigger tuareg-mode.

Start the OCaml REPL with M-x run-ocaml. To evaluate a phrase, simply type S-⟨return⟩ (shift and return). You can also evaluate a phrase in a different buffer by typing C-c C-e when the cursor is on it (it will start the OCaml REPL if needed).

Run the OCaml debugger with M-x ocamldebug FILE.

Thanks to the work of Stefan Monnier, a new indentation engine based on SMIE was written. This changes the indentation somewhat w.r.t. the previous versions of tuareg. If the indentation does not correspond to what you expect, please submit a motivated issue.

The standard Emacs customization tool can be used to configure Tuareg options. It is available from the Options menu and Tuareg's Customize sub-menu. Note that, at the moment, both customization options pertaining to the SMIE indentation mode and the old one are present.

You may also customize the appearance of OCaml code by twiddling the variables listed at the start of tuareg.el (preferably using tuareg-mode-hook, you should not patch the file directly). You should then add to your configuration file something like:

(add-hook 'tuareg-mode-hook
  (lambda () ... ; your customization code ))

For example:

(add-hook 'tuareg-mode-hook
          ;; Turn on auto-fill minor mode.
          #'auto-fill-mode)

See dot-emacs.el for some examples.

It is recommended to install Merlin which is available in OPAM. Tuareg will automatically detect it and use some of its features (e.g. for imenu). Merlin offers auto-completion, the possibility to query the type with C-cC-t, to find the location of an identifier with C-cC-l, to go to the next (resp. previous) phrase with C-cC-n (resp. C-cC-p),... Highly recommended.

If you happen to work with several switches, it is recommended to install opam-switch-mode (available in NonGNU ELPA and MELPA). This minor mode defines a command M-x opam-switch-set-switch as well as a menu-bar and a mode-bar menu "OPSW", to easily select another OPAM switch. Upon such a change, a hook kills the running OCaml toplevel, if any, so that the next eval command is run using the OCaml toplevel from the new switch.

caml-mode (available in NonGNU ELPA and MELPA) is used to display types (using the obsolete *.annot files), open a module for documentation,...

The official Tuareg home page is located at: https://github.com/ocaml/tuareg.

Bug reports & patches: use the tracker: https://github.com/ocaml/tuareg/issues.

Ian Zimmerman for the previous mode, compilation interface and debugger enhancement.

Jacques Garrigue enhanced Zimmerman's mode along with an adaptation to OCaml (and Labl) syntax. Although this work was performed independently, his useful test file and comments were of great help.

Michel Quercia for excellent suggestions, patches, and helpful emacs-lisp contributions (full, ready-to-work implementations, I should say), especially for Tuareg interactive mode, and browser capacities.

Denis Barthou, Pierre Boulet, Jean-Christophe Filliatre and Rémi Vanicat for intensive testing, useful suggestions, and help.

Ralf Treinen for maintaining the Debian GNU/Linux package.

Every people who sent me bug reports, suggestions, comments and patches. Nothing would have improved since version 0.9.2 without their help. Special thanks to Eli Barzilay, Josh Berdine, Christian Boos, Carsten Clasohm, Yann Coscoy, Prakash Countcham, Alvarado Cuihtlauac, Erwan David, Gilles Défourneaux, Philippe Esperet, Gilles Falcon, Tim Freeman, Alain Frisch, Christian Lindig, Claude Marché, Charles Martin, Dave Mason, Stefan Monnier, Toby Moth, Jean-Yves Moyen, Alex Ott, Christopher Quinn, Ohad Rodeh, Rauli Ruohonen, Hendrik Tews, Christophe Troestler, Joseph Sudish, Mattias Waldau and John Whitley.

Tuareg mode have been maintained by Albert Cohen until version 1.45.

Jane Street took over maintenance based on Albert Cohen's version 1.46 (later retracted by him), and released its first version as 2.0.

Tuareg is distributed under the GNU General Public License, version 3 or later.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4