run-sml does not work in emacs sml-mode

525 views Asked by At

I want to use sml-mode in emacs on Fedora. My ~/.emacs file contains

(add-to-list 'load-path "/home/gbuday/prooftheory/sml-mode")
(autoload 'sml-mode "sml-mode" "Major mode for editing SML." t)
(autoload 'run-sml "sml-proc" "Run an inferior SML process." t)

where that directory contains the git-cloned sml-mode files.

I edited sml-mode.el to have

(defcustom sml-program-name "/home/gbuday/prooftheory/polyml/bin/poly"
"Program to run as Standard SML read-eval-print loop."
:type 'string)

which indeed starts PolyML, the version I want to use.

When I type M-x run-sml to run an inferior SML read-eval-print loop I get

Cannot open load file: sml-proc

in the minibuffer. What should I do better here?

2

There are 2 answers

0
Rorschach On

There is no sml-proc file I'm aware of. What version of sml-mode are you using, it looks like the current is 6.7, and autoloading run-sml (or sml-run) should be done from sml-mode as well, eg

(autoload 'run-sml "sml-mode")

You should set the sml program with (setq sml-program-name ...) in your config file, you don't need to change the source code.

0
qiuweikang On

try this:

(setenv "PATH" (concat "/usr/local/smlnj/bin:" (getenv "PATH")))
(setq exec-path (cons "/usr/local/smlnj/bin"  exec-path))

replacing /usr/local with the appropriate path.