[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Introduction

SML mode is a major mode for Emacs for editing Standard ML. It has some novel bugs, and some nice features:

3.1 Contributors to the SML mode  Who did what
3.2 Getting started  What to tell Emacs
3.3 Help!  How Emacs can help

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1 Contributors to the SML mode

Contributions to the package are welcome. I have limited time to work on this project, but I will gladly add any code that you contribute to me to this package.

Although the history of sml-mode is obscure, it seems that the following persons have made contributions to sml-mode:

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2 Getting started

With luck your system administrator will have installed SML mode somewhere convenient, so it will just magically all work--you can skip the rest of this getting started section. Otherwise you will need to tell Emacs where to find all the SML mode `.el' files, and when to use them. The where is addressed by locating the Lisp code on your Emacs Lisp load path--you may have to create a directory for this, say `/home/mjm/elisp', and then insert the following lines in your `/home/mjm/.emacs' file:

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

The first line adjusts Emacs' internal search path so it can locate the Lisp source you have copied to that directory; the second and third lines tell Emacs to load the code automatically when it is needed. You can then switch any Emacs buffer into SML mode by entering the command

M-x sml-mode

It is usually more convenient to have Emacs automatically place the buffer in SML mode whenever you visit a file containing ML programs. The simplest way of achieving this is to put something like

(add-to-list 'auto-mode-alist '("\\.\\(sml\\|sig\\)\\'" . sml-mode))

also in your `.emacs' file. Subsequently (after a restart), any files with these extensions will be placed in SML mode buffers when you visit them.

You may want to pre-compile the `sml-*.el' files (M-x byte-compile-file) for greater speed--byte compiled code loads and runs somewhat faster.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3 Help!

You're reading it. Apart from the on-line info tree (C-h i is the Emacs key to enter the info system--you should follow the brief tutorial if this is unfamiliar), there are further details on specific commands in their documentation strings. Only the most useful SML mode commands are documented in the info tree: to find out more use Emacs' help facilities.

Briefly, to get help on a specific function use C-h f and enter the command name. All (almost all, then) SML mode commands begin with sml-, so if you type this and press TAB (for completion) you will get a list of all commands. Another way is to use C-h a and enter the string sml. This is command apropos; it will list all commands with that sub-string in their names, and any key binding they may have in the current buffer. Command apropos gives a one-line synopsis of what each command does.

Some commands are also variables--such things are allowed in Lisp, if not in ML! See section Command Index, for a list of (info) documented functions. See section Variable Index, for a list of user settable variables to control the behaviour of SML mode.

Before accessing this information on-line from within Emacs you may have to set the variable sml-mode-info. Put in your `.emacs' file something like:

(setq sml-mode-info "/home/mjm/info/sml-mode.info")

When different from the default this variable should be a string giving the absolute name of the `.info' file. Then C-c C-i in SML mode (i.e., the command M-x sml-mode-info) will bring up the manual. This help is also accessible from the menu. (Resetting this variable will not be necessary if your site administrator has been kind enough to install SML mode and its attendant documentation in the Emacs hierarchy.)

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by XEmacs Webmaster on October, 2 2007 using texi2html