~glorifiedgluer/gluer.org

4f2eb6c37b04e5c78d9c8ea1bb7572a3b174bdf7 — Victor Freire 4 months ago c33fe9d
article: configuring-gnu-emacs-for-standard-ml
1 files changed, 35 insertions(+), 1 deletions(-)

M content-org/content.org
M content-org/content.org => content-org/content.org +35 -1
@@ 4,7 4,7 @@
#+AUTHOR: ~glorifiedgluer

#+HUGO_BASE_DIR: ../
#+HUGO_PAIRED_SHORTCODES: alert image
#+HUGO_PAIRED_SHORTCODES: alert image marginnote sidenote

* Pages
:PROPERTIES:


@@ 5523,7 5523,41 @@ my Keychron K2V2.
  - ~echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmode~
  - ~echo 1 | sudo tee /sys/module/hid_apple/parameters/fnmode~


** Configuring GNU Emacs for Standard ML                         :sml:emacs:
:PROPERTIES:
:EXPORT_DATE: 2023-07-20
:EXPORT_FILE_NAME: configuring-gnu-emacs-for-standard-ml
:EXPORT_HUGO_SLUG: configuring-gnu-emacs-for-standard-ml
:END:

As mentioned on a [[*Thoughts on Standard ML as of 2023][previous post]], I've been writing quite a bit of
Standard ML on the past few weeks. This also involved setting up GNU
Emacs for development.

The first thing you need is ~sml-mode~, you can install and
configure it with the following:

#+begin_src elisp
(use-package sml-mode
  :defer t
  :mode ("\\.\\(sml\\|sig\\)\\'" . sml-mode))
#+end_src

Now, the cool part is that Standard ML has a Language Server called
[[https://github.com/azdavis/millet][Millet]]. You can use it with [[https://github.com/joaotavora/eglot][eglot]], the builtin Language Server
Protocol client for GNU Emacs.[fn:49]

#+begin_src elisp
(use-package eglot
  :ensure t
  :hook ((sml-mode . eglot-ensure))
  :config
  (add-to-list 'eglot-server-programs '((sml-mode) "millet-ls")))
#+end_src

* Footnotes
[fn:49] Since GNU Emacs 29.

[fn:48] [[https://www.polyml.org/][Poly/ML]] exposes a function that does just that: [[https://www.polyml.org/documentation/Reference/PolyMLStructure.html#print][PolyML.print]].
The problem now being tied to a single compiler...