Skip to content

Instantly share code, notes, and snippets.

@koddo
Last active December 11, 2015 05:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koddo/4555655 to your computer and use it in GitHub Desktop.
Save koddo/4555655 to your computer and use it in GitHub Desktop.
for Coursera / Programming Languages
;; for Coursera / Programming Languages
;; in emacs sml-mode: single keystroke for restarting repl and loading current file
(require 'cl)
(add-hook 'sml-mode-hook
(lambda ()
(define-key sml-mode-map (kbd "C-c C-v") 'my-sml-restart-repl-and-load-current-file)
(defun my-sml-restart-repl-and-load-current-file ()
(interactive)
(ignore-errors (with-current-buffer "*sml*"
(comint-interrupt-subjob)
(comint-send-eof)
(let ((some-time 0.1))
(while (process-status (get-process "sml"))
(sleep-for some-time)))))
(flet ((sml--read-run-cmd ()
'("sml" "" nil))) ; (command args host)
(sml-prog-proc-send-buffer t)))))
@firesofmay
Copy link

Thank you so much! :)
If you made any other code snippets for sml please do share.
PS - I am doing this course too right now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment