1
1
` reason-mode ` : A major Emacs mode for Reason syntax
2
2
============================================================
3
3
4
- This plugin is almost a drop in copy of the Rust plugin, with some
5
- modifications made. See original plugin here:
6
- https://github.com/rust-lang/rust-mode
4
+ At the moment this plugin is not deployed on Elpa. The sections below explains how to manually install it.
5
+ Alternatively, you can use [ quelpa] ( https://github.com/quelpa/quelpa ) and the following recipe:
7
6
7
+ ``` lisp
8
+ (quelpa '(reason-mode :repo "arichiardi/reason-mode" :fetcher github :stable t))
9
+ ```
8
10
9
11
### Manual Installation
10
12
@@ -42,19 +44,21 @@ To install manually, install the reason-cli (`npm -g install git://github.com/re
42
44
43
45
(setq merlin-ac-setup t)
44
46
```
47
+
45
48
If you have iedit mode set up:
46
- ```
49
+
50
+ ``` lisp
47
51
(require 'merlin-iedit)
48
52
(defun evil-custom-merlin-iedit ()
49
53
(interactive)
50
54
(if iedit-mode (iedit-mode)
51
55
(merlin-iedit-occurrences)))
52
56
(define-key merlin-mode-map (kbd "C-c C-e") 'evil-custom-merlin-iedit)
53
57
```
58
+
54
59
(Thanks @sgrove : [ https://gist.github.com/sgrove/c9bdfed77f4da8db108dfb2c188f7baf ] ( https://gist.github.com/sgrove/c9bdfed77f4da8db108dfb2c188f7baf ) )
55
60
56
- This associates ` reason-mode ` with ` .re ` and ` .rei ` files. To enable it explicitly, do
57
- <kbd >M-x reason-mode</kbd >.
61
+ This associates ` reason-mode ` with ` .re ` and ` .rei ` files. To enable it explicitly, do <kbd >M-x reason-mode</kbd >.
58
62
59
63
### Utop
60
64
@@ -64,7 +68,7 @@ First of all you need to install the [Utop Emacs integration](https://github.com
64
68
65
69
Then in your Emacs init file add:
66
70
67
- ```
71
+ ``` lisp
68
72
(require 'utop)
69
73
(setq utop-command "opam config exec -- rtop -emacs")
70
74
(add-hook 'reason-mode-hook #'utop-minor-mode) ;; can be included in the hook above as well
@@ -82,30 +86,30 @@ dotspacemacs-additional-packages
82
86
'(
83
87
(reason-mode
84
88
:location (recipe
85
- :repo "facebook /reason"
89
+ :repo "arichiardi /reason-mode "
86
90
:fetcher github
87
- :files ("editorSupport/emacs/ reason-mode.el" "editorSupport/emacs/ refmt.el")))
91
+ :files ("reason-mode.el" "refmt.el")))
88
92
)
89
93
```
90
94
91
95
Afterwards add the [ snippet] ( #manual-installation ) to your ` dotspacemacs/user-config ` .
96
+
92
97
### Features
93
98
94
99
#### Auto-format before saving
95
100
96
101
If you have refmt installed, you can add this to your ` .emacs ` file to enable
97
102
auto-format:
98
- ```
103
+
104
+ ``` lisp
99
105
(add-hook 'reason-mode-hook (lambda ()
100
106
(add-hook 'before-save-hook 'refmt-before-save)))
101
107
```
102
108
103
109
### Tests via ERT
104
110
105
- The file ` reason-mode-tests.el ` contains tests that can be run via
106
- [ ERT] ( http://www.gnu.org/software/emacs/manual/html_node/ert/index.html ) .
107
- You can use ` run_reason_emacs_tests.sh ` to run them in batch mode, if
108
- you set the environment variable EMACS to a program that runs emacs.
111
+ The ` test ` folder contains tests that can be run via [ ERT] ( http://www.gnu.org/software/emacs/manual/html_node/ert/index.html ) . You
112
+ can use ` run_reason_emacs_tests.sh ` to run them in batch mode, if you set the environment variable EMACS to a program that runs emacs.
109
113
110
114
To test it under emacs 23, which does not ship with ERT, download ert.el from
111
115
https://raw.githubusercontent.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert.el
0 commit comments