Skip to content

Commit c62ebab

Browse files
committed
Add quelpa recipe and tweaks
1 parent a4a73c1 commit c62ebab

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
`reason-mode`: A major Emacs mode for Reason syntax
22
============================================================
33

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:
76

7+
```lisp
8+
(quelpa '(reason-mode :repo "arichiardi/reason-mode" :fetcher github :stable t))
9+
```
810

911
### Manual Installation
1012

@@ -42,19 +44,21 @@ To install manually, install the reason-cli (`npm -g install git://github.com/re
4244
4345
(setq merlin-ac-setup t)
4446
```
47+
4548
If you have iedit mode set up:
46-
```
49+
50+
```lisp
4751
(require 'merlin-iedit)
4852
(defun evil-custom-merlin-iedit ()
4953
(interactive)
5054
(if iedit-mode (iedit-mode)
5155
(merlin-iedit-occurrences)))
5256
(define-key merlin-mode-map (kbd "C-c C-e") 'evil-custom-merlin-iedit)
5357
```
58+
5459
(Thanks @sgrove: [https://gist.github.com/sgrove/c9bdfed77f4da8db108dfb2c188f7baf](https://gist.github.com/sgrove/c9bdfed77f4da8db108dfb2c188f7baf))
5560

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>.
5862

5963
### Utop
6064

@@ -64,7 +68,7 @@ First of all you need to install the [Utop Emacs integration](https://github.com
6468

6569
Then in your Emacs init file add:
6670

67-
```
71+
```lisp
6872
(require 'utop)
6973
(setq utop-command "opam config exec -- rtop -emacs")
7074
(add-hook 'reason-mode-hook #'utop-minor-mode) ;; can be included in the hook above as well
@@ -82,30 +86,30 @@ dotspacemacs-additional-packages
8286
'(
8387
(reason-mode
8488
:location (recipe
85-
:repo "facebook/reason"
89+
:repo "arichiardi/reason-mode"
8690
:fetcher github
87-
:files ("editorSupport/emacs/reason-mode.el" "editorSupport/emacs/refmt.el")))
91+
:files ("reason-mode.el" "refmt.el")))
8892
)
8993
```
9094

9195
Afterwards add the [snippet](#manual-installation) to your `dotspacemacs/user-config`.
96+
9297
### Features
9398

9499
#### Auto-format before saving
95100

96101
If you have refmt installed, you can add this to your `.emacs` file to enable
97102
auto-format:
98-
```
103+
104+
```lisp
99105
(add-hook 'reason-mode-hook (lambda ()
100106
(add-hook 'before-save-hook 'refmt-before-save)))
101107
```
102108

103109
### Tests via ERT
104110

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.
109113

110114
To test it under emacs 23, which does not ship with ERT, download ert.el from
111115
https://raw.githubusercontent.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert.el

0 commit comments

Comments
 (0)