;;; 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))

;;; 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 "S-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))

Fix 'starts with non-prefix key M-SPC' error
Fix 'starts with non-prefix key M-SPC' error

Mentioned in #1947

hlissner/doom-emacs,hlissner/doom-emacs,UndeadKernel/emacs_doom,UndeadKernel/emacs_doom,hlissner/.emacs.d,hlissner/doom-emacs,hlissner/doom-emacs,hlissner/.emacs.d,hlissner/.emacs.d,hlissner/.emacs.d,hlissner/.emacs.d,UndeadKernel/emacs_doom,hlissner/.emacs.d,UndeadKernel/emacs_doom,hlissner/doom-emacs,UndeadKernel/emacs_doom,hlissner/.emacs.d,hlissner/doom-emacs,hlissner/doom-emacs,hlissner/.emacs.d,UndeadKernel/emacs_doom,UndeadKernel/emacs_doom