| 1 |
= Emacs |
| 2 |
|
| 3 |
== SML modes |
| 4 |
|
| 5 |
There are a few Emacs modes for SML. |
| 6 |
|
| 7 |
* https://elpa.gnu.org/packages/sml-mode.html |
| 8 |
|
| 9 |
* https://github.com/MLton/mlton/blob/master/ide/emacs/mlton.el[`mlton.el`] contains the Emacs lisp that <<StephenWeeks#>> uses to interact with MLton (in addition to using `sml-mode`). |
| 10 |
|
| 11 |
== MLB modes |
| 12 |
|
| 13 |
There is a mode for editing <<MLBasis#,ML Basis>> files. |
| 14 |
|
| 15 |
* https://github.com/MLton/mlton/blob/master/ide/emacs/esml-mlb-mode.el[`esml-mlb-mode.el`] (plus other files) |
| 16 |
|
| 17 |
== Completion |
| 18 |
|
| 19 |
* https://github.com/MatthewFluet/company-mlton[`company-mlton`] |
| 20 |
+ |
| 21 |
_____ |
| 22 |
https://github.com/MatthewFluet/company-mlton[`company-mlton`] is a |
| 23 |
https://company-mode.github.io/[`company-mode`] completion back-end for |
| 24 |
MLton/Standard ML. It provides completion for Standard ML keywords and for |
| 25 |
Standard ML (long) identifiers. Candidate completion identifiers for the latter |
| 26 |
are loaded from a basis file created by `mlton` using `-show-basis file` or |
| 27 |
`(*#showBasis "file"*)`. |
| 28 |
_____ |
| 29 |
|
| 30 |
== Definitions and uses |
| 31 |
|
| 32 |
There is a mode that supports the precise def-use information that |
| 33 |
MLton can output. It highlights definitions and uses and provides |
| 34 |
commands for navigation (e.g., `jump-to-def`, `jump-to-next`, |
| 35 |
`list-all-refs`). It can be handy, for example, for navigating in the |
| 36 |
MLton compiler source code. See <<EmacsDefUseMode#>> for further |
| 37 |
information. |
| 38 |
|
| 39 |
== Building in the background |
| 40 |
|
| 41 |
Tired of manually starting/stopping/restarting builds after editing |
| 42 |
files? Now you don't have to. See <<EmacsBgBuildMode#>> for further |
| 43 |
information. |
| 44 |
|
| 45 |
== Error messages |
| 46 |
|
| 47 |
MLton's error messages are not among those that the Emacs `next-error` |
| 48 |
parser natively understands. The easiest way to fix this is to add |
| 49 |
the following to your `.emacs` to teach Emacs to recognize MLton's |
| 50 |
error messages. |
| 51 |
|
| 52 |
[source,cl] |
| 53 |
---- |
| 54 |
(require 'compile) |
| 55 |
(add-to-list 'compilation-error-regexp-alist 'mlton) |
| 56 |
(add-to-list 'compilation-error-regexp-alist-alist |
| 57 |
'(mlton |
| 58 |
"^[[:space:]]*\\(\\(?:\\(Error\\)\\|\\(Warning\\)\\|\\(\\(?:\\(?:defn\\|spec\\) at\\)\\|\\(?:escape \\(?:from\\|to\\)\\)\\|\\(?:scoped at\\)\\)\\): \\(.+\\) \\([0-9]+\\)\\.\\([0-9]+\\)\\(?:-\\([0-9]+\\)\\.\\([0-9]+\\)\\)?\\.?\\)$" |
| 59 |
5 (6 . 8) (7 . 9) (3 . 4) 1)) |
| 60 |
---- |