Snippets
What are snippets ?

Snippets available here are pieces of code that one can use to modify the behaviour of Chamo or add new functionalities. The simplest way to use them is to place them in the file ~/.cameleon2/chamo_init.ml so that the code is evaluated when chamo.byte is launched.

How to get the snippets ?

There are two ways to retrieve these snippets:

  • By browsing the on-line documentation which contains links to the pieces of code. Then it's just a matter of copy/pasting the code somewhere to use it.
  • By using Caml-get: the archive containing the snippets is available from http://home.gna.org/cameleon/cameleon_snippets.cga. The two following commands can be used to successively add this archive to the known caml-get archives and add the code of module Greek_ocaml into the file ~/.cameleon2/chamo_init.ml.
    caml-get update http://home.gna.org/cameleon/cameleon_snippets.cga
    caml-get print Cameleon.Greek_ocaml -f ~/.cameleon2/chamo_init.ml
    
Available snippets

By now, the following snippets are available:

  • Greek_ocaml
    Display and use greek letters in your OCaml code. Here is a screenshot.
    greek letters in ocaml code
  • Html_kb
    This module defines a command html_of_key_bindings to output a html page summarizing the available key bindings.
  • Latex_mode
    This module defines a LaTeX mode for Chamo, including various commands useful when editing .tex files.
  • Ocaml_make
    Launch a "make" command in OCaml mode and parse ocaml error messages to open the indicated file at the indicated location, in case of error.
  • Remote_files
    Allow edition of files hosted on a remote machine, using scp transparently when opening and saving files.
  • Remove_trailing_whitespace
    Propose removing trailing whitespace of each line when saving a file in sourceview.
  • R_mode
    This module defines a R mode for Chamo, including a special R output and a "r_eval" function to make R evaluate the code in the active sourceview.
  • Stack_backtraces
    This module defines a new view for the Chamo editor. This view can be used to read files containing stack backtraces of programs ending with an uncaught exception (see option -g in OCaml manual). The different points of the program where the exception is raised are displayed in a list. When one of these points is selected, the corresponding file is open and the corresponding code is highlighted. A screenshot is below.
    The stack backtraces view