Update README to reflect new configuration
This commit is contained in:
parent
ff3a379c5b
commit
cdd4163d16
37
README.md
37
README.md
|
@ -135,21 +135,38 @@ you can copy-paste this code into you `~/.emacs` file:
|
||||||
|
|
||||||
Then you can execute utop inside emacs with: `M-x utop`.
|
Then you can execute utop inside emacs with: `M-x utop`.
|
||||||
|
|
||||||
Integration with the tuareg/typerex mode
|
utop also ships with a minor mode that has the following key-bindings
|
||||||
----------------------------------------
|
|
||||||
|
|
||||||
You can replace the default toplevel used by the tuareg or typerex
|
| key-binding | function | Description |
|
||||||
mode by utop, for that add the following lines to your `~/.emacs` file:
|
|-------------|-------------------|------------------------------|
|
||||||
|
| C-c C-z | utop | Start a utop buffer |
|
||||||
|
| C-x C-e | utop-eval-phrase | Evaluate the current phrase |
|
||||||
|
| C-x C-r | utop-eval-region | Evaluate the selected region |
|
||||||
|
| C-c C-b | utop-eval-buffer | Evaluate the current buffer |
|
||||||
|
| C-c C-k | utop-kill | Kill a running utop process |
|
||||||
|
|
||||||
|
You can enable the minor mode using `M-x utop-minor-mode`, or you can
|
||||||
|
have it enabled by default with the following configuration
|
||||||
|
|
||||||
```scheme
|
```scheme
|
||||||
(autoload 'utop-setup-ocaml-buffer "utop" "Toplevel for OCaml" t)
|
(autoload 'utop-minor-mode "utop" "Minor mode for utop" t)
|
||||||
(add-hook 'tuareg-mode-hook 'utop-setup-ocaml-buffer)
|
(add-hook 'tuareg-mode-hook 'utop-minor-mode)
|
||||||
(add-hook 'typerex-mode-hook 'utop-setup-ocaml-buffer)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also complete text in a tuareg or typerex buffer using the
|
If you plan to use utop with another major-mode than tuareg,
|
||||||
environment of the toplevel. For that bind the function
|
e.g. typerex, then you will need the following configuration instead
|
||||||
`utop-edit-complete` to the key you want.
|
|
||||||
|
```scheme
|
||||||
|
(autoload 'utop-minor-mode "utop" "Minor mode for utop" t)
|
||||||
|
(setq utop-skip-blank-and-comments 'typerex-skip-blank-and-comments)
|
||||||
|
(setq utop-skip-to-end-of-phrase 'typerex-skip-to-end-of-phrase)
|
||||||
|
(setq utop-discover-phrase 'typerex-discover-phrase)
|
||||||
|
(add-hook 'typerex-mode-hook 'utop-minor-mode)
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also complete text in a buffer using the environment of the
|
||||||
|
toplevel. For that bind the function `utop-edit-complete` to the key
|
||||||
|
you want.
|
||||||
|
|
||||||
Common error
|
Common error
|
||||||
------------
|
------------
|
||||||
|
|
Loading…
Reference in New Issue