diff --git a/docs/modules.org b/docs/modules.org index abe60842d..d0fa65e86 100644 --- a/docs/modules.org +++ b/docs/modules.org @@ -136,6 +136,7 @@ Modules that bring support for a language or group of languages to Emacs. + scala =+lsp= - TODO + [[file:../modules/lang/scheme/README.org][scheme]] - TODO + [[file:../modules/lang/sh/README.org][sh]] =+fish +lsp= - TODO ++ [[file:../modules/lang/sml/README.org][sml]] - TODO + [[file:../modules/lang/solidity/README.org][solidity]] - TODO + swift =+lsp= - TODO + terra - TODO diff --git a/init.example.el b/init.example.el index 55d05cf38..25bf97f3f 100644 --- a/init.example.el +++ b/init.example.el @@ -152,6 +152,7 @@ ;;scala ; java, but good ;;scheme ; a fully conniving family of lisps sh ; she sells {ba,z,fi}sh shells on the C xor + ;;sml ;;solidity ; do you need a blockchain? No. ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. diff --git a/modules/lang/sml/README.org b/modules/lang/sml/README.org new file mode 100644 index 000000000..66543cda6 --- /dev/null +++ b/modules/lang/sml/README.org @@ -0,0 +1,39 @@ +#+TITLE: lang/sml +#+DATE: March 29, 2020 +#+SINCE: v3.0 +#+STARTUP: inlineimages nofold + +* Table of Contents :TOC_3:noexport: +- [[#description][Description]] + - [[#maintainers][Maintainers]] + - [[#module-flags][Module Flags]] + - [[#plugins][Plugins]] +- [[#prerequisites][Prerequisites]] +- [[#features][Features]] +- [[#configuration][Configuration]] +- [[#troubleshooting][Troubleshooting]] + +* Description +This module has no description yet. + +** Maintainers +This module has no dedicated maintainers. + +** Module Flags +This module provides no flags. + +** Plugins ++ sml-mode ++ company-mlton (=:completion company=) + +* TODO Prerequisites +# Document how to install sml program and MLton + +* TODO Features +# An in-depth list of features, how to use them, and their dependencies. + +* TODO Configuration +# How to configure this module, including common problems and how to address them. + +* TODO Troubleshooting +# Common issues and their solution, or places to look for help. diff --git a/modules/lang/sml/config.el b/modules/lang/sml/config.el new file mode 100644 index 000000000..4b6f62690 --- /dev/null +++ b/modules/lang/sml/config.el @@ -0,0 +1,27 @@ +;;; lang/sml/config.el -*- lexical-binding: t; -*- + +(use-package! sml-mode + :mode "\\.s\\(?:ml\\|ig\\)\\'" + :config + (set-repl-handler! 'sml-mode #'run-sml) + + ;; don't auto-close apostrophes (type 'a = foo) and backticks (`Foo) + (sp-with-modes 'sml-mode + (sp-local-pair "'" nil :actions nil) + (sp-local-pair "`" nil :actions nil)) + + (map! :map sml-mode-map + :i "RET" #'reindent-then-newline-and-indent + :i "M-SPC" #'sml-electric-space + :i "|" #'sml-electric-pipe + :localleader + :desc "Run SML" "'" #'run-sml + :prefix ("e" . "eval") + :desc "Run buffer" "b" #'sml-prog-proc-send-buffer + :desc "Run the paragraph" "f" #'sml-send-function + :desc "Run region" "r" #'sml-prog-proc-send-region)) + + +(use-package! company-mlton + :when (featurep! :completion company) + :hook (sml-mode . company-mlton-init)) diff --git a/modules/lang/sml/packages.el b/modules/lang/sml/packages.el new file mode 100644 index 000000000..38c9ef76a --- /dev/null +++ b/modules/lang/sml/packages.el @@ -0,0 +1,8 @@ +;; -*- no-byte-compile: t; -*- +;;; lang/sml/packages.el + +(package! sml-mode :pin "60b01d7ebc") +(when (featurep! :completion company) + (package! company-mlton + :recipe (:host github :repo "MatthewFluet/company-mlton" :files ("*.el" "*.basis")) + :pin "b87e36348f"))