]> code.delx.au - gnu-emacs-elpa/commitdiff
* sml-mode.texi: somewhat updated the doc.
authormonnier <>
Wed, 11 Aug 1999 19:48:17 +0000 (19:48 +0000)
committermonnier <>
Wed, 11 Aug 1999 19:48:17 +0000 (19:48 +0000)
* release 3.9.3

BUGS
ChangeLog
INSTALL [new file with mode: 0644]
Makefile
NEWS
README
TODO
sml-mode-startup.el
sml-mode.el
sml-mode.texi
sml-proc.el

diff --git a/BUGS b/BUGS
index 2670bea5220a4c066f6e36081da5dfe1b896797a..77e2bdbe6d2cf27a48f1bf79594bd995d7fa44ba 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -1,4 +1,8 @@
-* indentation of a declaration after a long `datatype' is slow
+-*- text -*-
+
+Here are the current known bugs.
+If you find any other, send it to <monnier+lists.emacs.sml@tequila.cs.yale.edu>.
 
-* buggy indentation samples:
+* indentation of a declaration after a long `datatype' is slow
 
+* buggy indentation samples:  none??
index d7f804a80bd890a60a75ca570f31e91700ec70cd..9c3b59f45d5c7401a7ee996128b813589f7b059e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-08-11  Stefan Monnier  <monnier@cs.yale.edu>
+
+       * release: version 3.9.3
+
+       * sml-mode.texi:  somewhat updated the doc.
+
 1999-08-09  Stefan Monnier  <monnier@cs.yale.edu>
 
        * Makefile: updated to the version of pcl-cvs.
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..b125735
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,47 @@
+SML-MODE shouldn't require any special external support package,
+as far as I can rememebr.  Just a recent copy of Emacs or XEmacs.
+
+Installation of the program
+===================================
+
+  1. Edit the file `Makefile' to reflect the situation at your site.
+     The only things you have to change is the definition of `lispdir'
+     and `infodir'.  The elisp files will be copied to `lispdir', and
+     the info file to `infodir'.
+
+  2. Have some sorbet.
+
+  3. Type `make install' in the source directory.  This will
+     byte-compile all `.el' files and copy all the
+     `.elc' files into the directory you specified in step 1.
+     It will also copy the info files (and add a corresponding entry to the
+     info-dir file if install-info can be found).
+
+     If you want to install the `.el' files,
+     just type ``make install_el''.
+
+     If you only want to create the compiled elisp files, but don't
+     want to install them, you can type `make elcfiles' instead.
+
+  4. Edit the file `site-start.el' in your emacs lisp directory (usually
+     `/usr/local/share/emacs/site-lisp' or something similar) and enter the
+     contents of the file `sml-mode-startup.el' into it.  It contains
+     a couple of `auto-load's that facilitates the use of sml-mode.
+     Alternatively, you can just use `make install_startup'.
+     If you're only installing it for yourself rather than for the whole system,
+     then use something like `make install_startup startupfile=$HOME/.emacs'.
+
+  5. If you already had copied the pcl-cvs.startup.el file to your
+     site-start.el (or .emacs), you might want to check if it is still correct
+     since autoloads might have been added/removed.
+
+
+How to make typeset documentation from the TeXinfo manual
+=========================================================
+
+   If you have TeX installed at your site, you can make a typeset version of
+the manual typing ``make dvi''.  If you prefer a postscript version of this
+file, just use ``make postscript''.
+
+
+#ident @(#)$Name$:$Id$
index 40dd91d63657e68c3362499451b302fd093ae965..9726421ed9f23ee9fcafb824a531ffad8a3084b5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,7 @@ datadir = $(prefix)/share
 
 # the directory where you install third-party emacs packges
 lispdir = $(datadir)/emacs/site-lisp
+startupfile = $(lispdir)/site-start.el
 
 # the directory where you installed the elib .elc files.
 # This is only needed if your site-start.el (or default.el) does not
@@ -62,6 +63,7 @@ TEXEXTS =  *.cps *.fns *.kys *.vr *.tp *.pg *.log *.aux *.toc *.cp *.ky *.fn
 .SUFFIXES: .elc .el .info .ps .dvi .texi
 .PHONY: elcfiles info clean distclean default
 .PHONY: install_startup install_elc install install_el install_info
+.PHONY: dvi postscript
 
 .el.elc:
        $(ELC) $<
@@ -97,16 +99,18 @@ install_info: $(PACKAGE).info
 
 install_startup:
        $(MKDIR) $(lispdir)
-       if grep $(PACKAGE) $(lispdir)/site-start.el >/dev/null 2>&1 || \
+       if grep $(PACKAGE) $(startupfile) >/dev/null 2>&1 || \
           grep $(PACKAGE) $(lispdir)/default.el >/dev/null 2>&1; then \
            echo "!!! Check $(PACKAGE)-startup.el and merge it" \
-           echo "!!! into your $(lispdir)/site-start.el file"; \
+           echo "!!! into your $(startupfile) file"; \
        else \
            sed 's|@elcdir@|$(elcdir)|' \
-               $(PACKAGE)-startup.el >>$(lispdir)/site-start.el ;\
+               $(PACKAGE)-startup.el >>$(startupfile) ;\
        fi
 
-install_dvi: $(PACKAGE).dvi
+postscript: $(PACKAGE).ps
+dvi: $(PACKAGE).dvi
+install_dvi: dvi
        $(MKDIR) $(docdir)
        $(CP) *.dvi $(docdir)/
 
diff --git a/NEWS b/NEWS
index 661af3667ef1021c559341609ca0981ab5d30d3d..dffeed9db586e9572c6f51d3ed9af5c98e7f5fa6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,61 @@
 -*- text -*-
 
+Changes since 3.3:
+
+* the sml-drag-* commands have disappeared.
+
+* added a little bit of `customize' support.  Many of the customization
+  variables for indentation are still in flux, so they are not customize'd.
+
+* proformas have been replaced by skeletons.  it's mostly the same as
+  before (the layout has slightly changed, tho).  The main difference
+  is that the indentation relies on the major-mode indentation so it
+  is implicitly customized, which makes more sense to me.
+  Also I added an electric space M-SPC that will call the corresponding
+  skeleton if any matches the immediately preceding symbol.  Basically
+  that allows you to type `l e t M-SPC' to call the `let' skeleton.
+
+* M-C-f and M-C-b try to be smart and jump around let..end and such blocks.
+  It's probably either too smart or not smart enough, tho.
+
+* there is no more sml-<compiler>.el since the code should work for "all"
+  known compilers.  If your favorite compiler doesn't seem to work right
+  send me a sample session.
+
+* hilite support has disappeared and font-lock and menu support is now built-in.
+
+* the indentation algorithm is inherently much slower.  I've tried to ensure
+  the slowness never manifests itself in practice, but if you find a case
+  where the indentation doesn't feel instantaneous, tell me.
+
+* function arguments get properly indented (yes, madam).
+
+* the indentation has been majorly reworked.  The list of changes is too long.
+  Many customizations have disappeared, some may reappear depending on the
+  feedback I get.  The indentation should now "always" work right, so
+  tell me when it doesn't.
+
+* nested comments are only properly handled if you have a nested-comments
+  aware Emacs (I don't know of any yet) or if you turn on font-lock.
+
+* provide `sml-compile' which does something similat to `compile' except it
+  passes the command to an inferior-sml process.  Also it has an additional
+  hack to look for sml-make-file-name in parent directories and cd to it
+  before sending the command (handy for CM.make() when the sources.cm file
+  is not in the current directory).  This hack is very ad-hoc and quite
+  misleading for people who don't use CM.  I.e. the default is not safe.
+
+* sml-send-region and friends now always use a temp file.  The temp file
+  management has been made a little more secure.
+
+* the overlay is now turned off by default.  Instead the region is activated,
+  so that transient-mark-mode will end up highlighting the error just like
+  the overlay used to do.
+
+* sml-proc uses compile.el for error parsing.  This mostly means that instead
+  of C-c ` you want to use the standard C-x `.  It also means that error
+  formats for any compiler can be added more easily.
+
 * The special frame handling has been thrown out because it doesn't interact
   well with Emacs' own similar feature.  I believe XEmacs still doesn't provide
   such a feature, so if you miss it, either switch to Emacs or (convince
diff --git a/README b/README
index 89a470085166bfee3be28d6a25fd740b9420b8de..ac81c6ce1346c929df3e876de6250a93fb0f9539 100644 (file)
--- a/README
+++ b/README
-SML-MODE (3.3b) -- Major Emacs mode for editing Standard ML.
+SML-MODE is a major Emacs mode for editing Standard ML.
+It provides syntax highlighting and automatic indentation and
+comes with sml-proc which allows interaction with an inferior SML
+interactive loop.
 
-  3.3(beta) because i really am looking at the indentation algorithm,
-  but the new features mentioned below are stable -- modulo bugs.
+This release should work on any recent version of Emacs or XEmacs.
+If it doesn't: complain.
 
-Files:
+Some more or less out of date documentation can be found in TeXinfo format.
 
-  sml-mode.el     (SML mode elisp code)
-  sml-proc.el     (ML interaction code, defaults to SML/NJ(0.93))
-  sml-hilite.el   (hilit19 functions)
-  sml-font.el     (font-lock functions)
-  sml-menus.el    (Simple menus)
+Check the INSTALL file for installation instructions.
+Check the NEWS file for a list of changes in this version.
+Check the BUGS and TODO file before sending me bug reports and requests for
+enhancements.
 
-  sml-poly-ml.el  (Additional library code to run Poly/ML)
-  sml-mosml.el    (Additional library code to run Moscow ML)
+Send any complaint/question/praise/ice-cream to me,
 
-  sml-mode.info   (Softcopy manual -- Info for (X)Emacs19)
-  sml-site.el     (Simple, system-wide installation)
 
-Extras:
-
-  sml-mode.dvi    (Hardcopy manual)
-
-Warning:
-
-  Tried and sort of tested on GNU Emacs 19.3{3,4} and XEmacs 19.14.
-
-  XEmacs 19.11 is known to hang on sending regions to the interaction
-  buffer -- so leave the variable SML-TEMP-THRESHOLD = 0.
-
-System Installation Guide:
-
-  If you're installing this for others in the Emacs hierarchy, either
-
-    go to the site-lisp directory and unpack the tar file there, 
-
-    or create a subdirectory, say site-lisp/sml-mode, and copy at
-    least the sml*.el files into it.
-
-  In either case move or copy the file sml-site.el into the site-lisp
-  directory itself (or some other place that's on the user's default
-  load-path) and read and edit this file. All that's really needed is
-  to ensure that Emacs can find the sml*.el files and the .info file.
-
-  Tell your eager users to
-
-  (requite 'sml-site) 
-
-  in their .emacses. Point them to the help file. At your option, byte
-  compile the sml*.el files (and sml-site.el too, if you like).
-
-Private Installation Guide:
-
-  If you are having to install his in your home directory, say, create
-  a directory like "/home/xxx/lib/emacs/sml-mode", if your login name
-  is xxx, and copy the sml-*.el files to there. Then put:
-  
-  (setq load-path (cons "/home/xxx/lib/emacs/sml-mode" load-path))
-  (autoload 'sml-mode "sml-mode" "Major mode for editing ML programs." t)
-
-  in your .emacs file. Add:
-
-  (setq auto-mode-alist
-        (append '(("\\.sml$" . sml-mode) 
-                  ("\\.sig$" . sml-mode) 
-                  ("\\.ML$"  . sml-mode)) auto-mode-alist))
-
-  to your .emacs so that whenever you visit a file with one of these
-  extensions you will automatically be placed in sml-mode.
-
-  Put the info file (sml-mode.info) somewhere convenient like
-  "/home/xxx/lib/emacs/sml-mode/sml-mode.info", and add
-
-  (setq sml-mode-info "/home/xxx/lib/emacs/sml-mode/sml-mode.info")
-
-  again to your .emacs -- this gives access to on-line help. This help
-  file gives lots of tips about configuring SML mode to suit your
-  preferences: C-c C-i will get you there from SML mode.
-
-  If you want SML mode to speak to Moscow ML or Poly/ML instead of
-  SML/NJ, just add something like this to your .emacs:
-
-  (defun my-mosml-setup () "Configure inferior SML mode for Moscow ML"
-    (load-library "sml-mosml"))
-  (add-hook 'inferior-sml-load-hook 'my-mosml-setup)
-
-  so that when you M-x sml you'll get mosml instead.
-
-New in SML mode Version 3.3 (feedback welcomed on this):
-
-  1
-
-  implemented some multi-frame handling capabilities, specifically so 
-  sml runs in a dedicated window. this is more complex than it needs to
-  be because of XEmacs...
-
-  the variable SML-DEDICATED-FRAME defaults to t if running under a
-  window system; set it to nil in SML-LOAD-HOOK if you want the old
-  split window behaviour back.
-
-  2
-
-  debugged SML-NEXT-ERROR a bit, and improved it to echo the error
-  message in the minibuffer (if possible) and highlight the region in
-  which the error was found (if a suitable character range was given).
-
-  the variable SML-ERROR-OVERLAY controls whether or not to highlight
-  (default is yes); set this to nil in SML-MODE-HOOK to switch this
-  off. 
-
-  SML-NEXT-ERROR won't always raise the inferior ML buffer's frame; it
-  only does so if there's no window already showing the buffer, or if
-  there's an error message it can't understand. i think!
-
-  3
-
-  support for Moscow ML -- see sml-mosml.el.
-
-  4
-
-  forms (aka, templates or macros) insertion semantics have changed
-  because there were bugs. maybe there still are, but anyway: by
-  default C-c C-m inserts the macro at point, C-u C-c C-m will do a
-  newline-and-indent before inserting the macro.
-
-  abstractions are history, and you can play with extending the
-  collection of builtin macros to your heart's content. lookup the
-  function SML-ADDTO-FORMS-ALIST, and the variable SML-FORMS-ALIST.
-
-  5
-
-  drag-and-droppishness, without the drop: SML-DRAG-MOUSE is bound to
-  M-S-down-mouse-1; if you drag the mouse over a region it will be
-  magically sucked into the ML buffer (like C-c C-r, only you don't
-  have to C-@ first). this might be flakey as it heavily depends on
-  the underlying mouse-drag/track-mouse semantics of the various
-  Emacses out there. can't do much about that, sorry.
-
-  6
-
-  anything else i've forgotten already!
-
-To Do:
-
-  0
-
-  indentation is hopeless for sequential code (semicolons). this needs
-  attention; indeed all the indentation code does. Ian Zimmerman's very
-  excellent (looking) indentation code for caml-mode may point the way
-  forward. or we all go over to programming in Lisp instead of ML...
-
-Matthew Morley <mjm@scs.leeds.ac.uk>
-05/97
+       Stefan Monnier <monnier+lists/emacs/sml@tequila.cs.yale.edu>
diff --git a/TODO b/TODO
index 8ab7fb027ee5bc46deea1290b781dba5e3403388..2800f1477b622bd3067c973b227a15d2ed1d6503 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,8 +1,18 @@
--*- sml -*-
+-*- text -*-
+
+* improve M-C-f and M-C-b (they too often don't do the right thing) and
+  add M-C-k and other such sexp-chunked operations.
 
 * if indentation is non-obvious, return a list of possible indentations
   and choose the first unless the current is one of the possible choices.
 
+* make `M-x sml-compile' more generic.
+
+* allow specifying indentation of dependent keywords (how to indent `in'
+  relative to `let', for example).
+
+* use symbols instead of strings for `sym'.
+
 * ignore warnings in C-x ` ????
 
 * recognize irrefutable patterns (with "Capital"-heuristics, for example).
                (fn x =>
                 some expressions)
 
-* obey fixity directives
+* find the enclosing function's name for add-change-log-entry.
+
+* obey fixity directives.
 
-* improve the run-sml to allow running on another machine and to take args
+* improve the run-sml to allow running on another machine and to take args.
 
 * right-align "and" with its correspondant.
 
-* sample problematic indentations:
+* sample indentations to be improved:
index ee58a5c3a428e110a0944ada9f08506cd80ace03..998aa56e72635dce8222a2ca863ab1f391b112d4 100644 (file)
@@ -15,7 +15,7 @@
 
 ;; the rest is the auto-generated autoloads
 \f
-;;;### (autoloads (sml-mode) "sml-mode" "sml-mode.el" (14249 59771))
+;;;### (autoloads (sml-mode) "sml-mode" "sml-mode.el" (14257 57462))
 ;;; Generated autoloads from sml-mode.el
 
 (autoload (quote sml-mode) "sml-mode" "\
@@ -25,8 +25,7 @@ Entry to this mode runs the hooks on sml-mode-hook.
 
 ;;;***
 \f
-;;;### (autoloads (sml-load-file sml-send-buffer sml-send-region
-;;;;;;  switch-to-sml run-sml) "sml-proc" "sml-proc.el" (14255 18522))
+;;;### (autoloads (run-sml) "sml-proc" "sml-proc.el" (14257 55157))
 ;;; Generated autoloads from sml-proc.el
 
 (autoload (quote run-sml) "sml-proc" "\
@@ -45,31 +44,6 @@ current one -- given by `sml-buffer' (qv).
 
 \(Type \\[describe-mode] in the process buffer for a list of commands.)" t nil)
 
-(autoload (quote switch-to-sml) "sml-proc" "\
-Switch to the ML process buffer.
-With prefix argument, positions cursor at point, otherwise at end of buffer." t nil)
-
-(autoload (quote sml-send-region) "sml-proc" "\
-Send current region to the inferior ML process.
-Prefix argument means switch-to-sml afterwards.
-
-The region is written out to a temporary file and a \"use <temp-file>\" command
-is sent to the compiler.
-See variables `sml-use-command'." t nil)
-
-(autoload (quote sml-send-buffer) "sml-proc" "\
-Send buffer to inferior shell running ML process. 
-With a prefix argument switch to the sml buffer as well
-\(cf. `sml-send-region')." t nil)
-
-(autoload (quote sml-load-file) "sml-proc" "\
-Load an ML file into the current inferior ML process. 
-With a prefix argument switch to sml buffer as well.
-
-This command uses the ML command template `sml-use-command' to construct
-the command to send to the ML process; a trailing \";\\n\" will be added
-automatically." t nil)
-
 ;;;***
 \f
 ;;; Local Variables:
index 8098ed0532e5f93666b17e53e371e287ab647538..f28c69fda54b8800e342a5cbf84b21a2dcc0a199 100644 (file)
@@ -1,4 +1,4 @@
-;;; sml-mode.el. Major mode for editing (Standard) ML. Version 3.3(beta)
+;;; sml-mode.el. Major mode for editing (Standard) ML
 
 (defconst rcsid-sml-mode "@(#)$Name$:$Id$")
 
 
 ;;; VERSION STRING
 
-(defconst sml-mode-version-string "sml-mode, version 3.9.2")
+(defconst sml-mode-version "version $Name$")
 
 (require 'cl)
 (require 'sml-util)
@@ -290,12 +290,12 @@ Full documentation will be available after autoloading the function."))
 (defun sml-mode-version ()
   "This file's version number (sml-mode)."
   (interactive)
-  (message sml-mode-version-string))
+  (message sml-mode-version))
 
 ;;;###Autoload
 (defun sml-mode ()
   "Major mode for editing ML code.
-Entry to this mode runs the hooks on sml-mode-hook.
+Entry to this mode runs the hooks on `sml-mode-hook'.
 \\{sml-mode-map}"
 
   (interactive)
index 6c93986f08d627c433a49ab1388adb1ec95e2039..ba471e768ff41d8b39fe46cca6c98cee7273e72b 100644 (file)
@@ -3,9 +3,9 @@
 @comment "@(#)$Name$:$Id$"
 
 @comment Documentation for the GNU Emacs SML mode.
-@comment Copyright (C) 1999 (Anon)
+@comment Copyright (C) 1997-1999 Matthew J.@: Morley
 
-@comment This file is part of the pcl-cvs distribution.
+@comment This file is part of the sml-mode distribution.
 
 @comment sml-mode is free software; you can redistribute it and/or modify
 @comment it under the terms of the GNU General Public License as published by
 
 @titlepage
 @sp 5
-@center @titlefont{Editing and running Standard ML}
+@center @titlefont{Editing and Running Standard ML}
 @center @titlefont{under GNU Emacs}
 @sp 5
-@center {SML mode, Version 3.3}
-@center {April 1997}
+@center {SML mode, Version $Name$}
+@center {August 1999}
 @sp 2
 @author Author: Matthew J.@: Morley
 
@@ -77,7 +77,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
 @noindent
 You are looking at the top node of the Info tree documenting
-@sc{sml-mode} (Version 3.3). Not all functions are documented here, but
+@sc{sml-mode} (Version $Name$). Not all functions are documented here, but
 those that aren't you probably won't miss. All commands and settable
 variables have built-in documentation, as per usual Emacs conventions.
 @end ifinfo
@@ -88,7 +88,6 @@ variables have built-in documentation, as per usual Emacs conventions.
 * SML Mode::            Editing SML source
 * Interaction Mode::    Running ML processes
 * Configuration::       Menus, highlighting, setting defaults
-* Credits::             Credit and blame
 
 Indexes
 * Command Index::       Commands you can invoke
@@ -96,7 +95,7 @@ Indexes
 * Key Index::           Default keybindings
 
 Introduction
-* Distribution::        What this distribution contains
+* Contributors::        Who did what
 * Getting Started::     What to tell Emacs
 * Getting Help::        How Emacs can help
 
@@ -115,7 +114,6 @@ Interaction Mode
 Configuration
 * Hooks::               Creating hooks
 * Key Bindings::        Binding commands to keys
-* Menus::               Taking advantage of bitmapped screens
 * Highlighting::        Syntax colouring
 * Advanced Topics::     You may need to speak Emacs Lisp
 @end menu
@@ -188,110 +186,99 @@ Menus, and syntax and keyword highlighting supported for Emacs 19 and
 derivatives.
 @item
 Parsing errors from the inferior shell, and repositioning the
-source---much like the next-error function used in c-mode.
+source with next-error---just like in c-mode.
 @item
 SML mode can be easily configured to work with a number of Standard
 ML compilers, and other SML based tools.
 @end itemize
 
 @menu
-* Distribution::        What this distribution contains
+* Contributors::        Who did what
 * Getting Started::     What to tell Emacs
 * Getting Help::        How Emacs can help
 @end menu
 
 
 
-@c ======================================================== DISTRIBUTION
+@c ======================================================== CONTRIBUTORS
 
-@node Distribution, Getting Started, Introduction, Introduction
+@node Contributors, Getting Started, Introduction, Introduction
 
-@section The SML mode distribution
+@section Contributors to the SML mode
+@cindex Contributors
+@cindex Authors
 
-@c == Distribution, Getting Started, Introduction, Introduction ========
+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:
 
-@noindent
-The distribution contains several Emacs Lisp files---this is for ease of
-maintenance, you can concatenate them if you're careful:
-
-@table @file
-@item sml-mode.el
-Main file, and should work in any Emacs editor or version post
-18.58---it only knows, or thinks it knows, about SML syntax and
-indentation.
-
-@item sml-menus.el
-Menus to access user settable features of the mode, and for those who
-prefer menus over keys under Emacs 19 and derivatives.
-
-@item sml-@{hilite,font@}.el
-Syntax highlighting functions to display keywords in a bold font,
-comments in italics, etc., using one of Emacs' two popular syntax
-colouring packages.
-
-@item sml-proc.el
-Process interaction requires the @file{comint} package (normally
-distributed with Emacs 19 and derivatives).
+@itemize @bullet
+@item
+Lars Bo Nielsen wrote the original version of the code, providing the
+sml editing mode and the inferior-sml support.
 
-@item sml-@{poly-ml,mosml@}.el
-Auxiliary library support for Poly/ML and Moscow ML compilers. 
-@c Set these up to autoload from your @file{.emacs}.
+@item
+Olin Shivers (@samp{shivers@@ai.mit.edu}) hacked the inferior-sml support
+to use comint and call the whole thing ml-mode.
 
-@end table
+@item
+Steven Gilmore supposedly provided some early attempt at menubar support.
 
-@noindent There is also the Texinfo generated @code{info} file:
+@item
+Matthew J. Morley (@samp{matthew@@verisity.com}) was maintainer for
+a long time (until version 3.4) and provided many additions and fixes in
+all areas.
 
-@table @file
+@item
+Frederick Knabe (@samp{knabe@@ecrc.de}) provided the original code for
+font-lock and hilite support as well as for proper handling of nested
+comments and of all the string escape sequences.
 
-@item sml-mode.@{dvi,info@}
-@c itemx sml-mode.dvi
-This file---rudimentary SML mode documentation, and
+@item
+Matthias Blume (@samp{blume@@kurims.kyoto-u.ac.jp}) provided a sml-make
+which was replaced by sml-compile.
 
-@item sml-site.el
-Configuration file for system-wide installation. Read and edit this file
-if you are installing SML mode for general use.
+@item
+Monnier Stefan (@samp{monnier@@cs.yale.edu}) completely reworked the
+indentation engine as well as most of the rest of the code and is
+the current maintainer since after version 3.4.
 
-@end table
+@end itemize
 
 
 @c ===================================================== GETTING STARTED
 
-@node Getting Started, Getting Help, Distribution, Introduction
+@node Getting Started, Getting Help, Contributors, Introduction
 
 @section Getting started
 
-@c == Getting Started, Getting Help, Distribution, Introduction ========
+@c == Getting Started, Getting Help, Contributors, Introduction ========
 
 
 @noindent
 With luck your system administrator will have installed SML mode
-somewhere convenient, so all you have to do is put the line
-
-@lisp
-(require 'sml-site)
-@end lisp
-
-@noindent
-in your @file{.emacs} configuration file and all will be well---you can
+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 @file{.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 @file{/home/mjm/elisp}, and then insert the following lines in your
-@file{/home/mjm/.emacs} file@footnote{cf.@: commentary in the site
-initialisation file @file{sml-site.el}.}:
+@file{/home/mjm/.emacs} file:
 
 @lisp
-(setq load-path (cons "/home/mjm/elisp" load-path))
+(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)
 @end lisp
 
 @noindent
 The first line adjusts Emacs' internal search path so it can locate the
-Lisp source you have copied to that directory; the second line tells
-Emacs to load the code automatically when it is needed. You can then
-switch any Emacs buffer into SML mode by entering the command
+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
 
 @example
 M-x sml-mode
@@ -303,10 +290,7 @@ buffer in SML mode whenever you visit a file containing ML
 programs. The simplest way of achieving this is to put something like
 
 @lisp
-(setq auto-mode-alist
-      (append '(("\\.sml$" . sml-mode) 
-                ("\\.sig$" . sml-mode) 
-                ("\\.ML$"  . sml-mode)) auto-mode-alist))
+(add-to-list 'auto-mode-alist '("\\.\\(sml\\|sig\\)\\'" . sml-mode))
 @end lisp
 
 @noindent
@@ -319,11 +303,6 @@ You may want to pre-compile the @file{sml-*.el} files (@kbd{M-x
 byte-compile-file}) for greater speed---byte compiled code loads and
 runs somewhat faster.
 
-@c If you are irritated by the fact that there are several @sc{sml}
-@c mode lisp files concatenate them in the order I listed them (but
-@c don't include @file{sml-site} which should be kept apart).
-
-
 
 @c ======================================================== GETTING HELP
 
@@ -387,14 +366,13 @@ Emacs hierarchy.)
 
 
 @noindent
-Now SML mode provides just a few additional editing commands. Most
-of the work (@pxref{Credits,,Credit & Blame}) has gone into implementing
-the indentation algorithm which, if you think about it, has to be
-complicated for a language like ML. @xref{SML Mode Defaults,,Indentation
-Defaults}, for details on how to control some of the behaviour of the
-indentation algorithm. Principal goodies are the `electric pipe'
-feature, and the ability to insert common SML forms (macros or
-templates).
+Now SML mode provides just a few additional editing commands. Most of
+the work has gone into implementing the indentation algorithm which, if
+you think about it, has to be complicated for a language like
+ML. @xref{SML Mode Defaults,,Indentation Defaults}, for details on how
+to control some of the behaviour of the indentation algorithm. Principal
+goodies are the `electric pipe' feature, and the ability to insert
+common SML forms (macros or templates).
 
 @menu
 * Basics::              On entering SML mode
@@ -438,21 +416,13 @@ bindings. @xref{Configuration}, for some examples.
 
 
 @defvr Hook sml-load-hook
-Default: @code{'sml-mode-version}
+Default: @code{nil}
 
 Another, maybe better, place for key bindings. This hook is only run when
 SML mode is loaded into Emacs. @xref{Configuration}.
 @end defvr
 
 
-@deffn Command sml-mode-version
-Prints the current version of SML mode in the mini-buffer, in case
-you need to know. I've put it on @code{sml-load-hook} so you can easily
-tell which version of SML mode you are running.
-@end deffn
-
-
-
 @c ========================================================= INDENTATION
 
 @node Indentation, Magic Insertion, Basics, SML Mode
@@ -470,17 +440,17 @@ adjusted to control the indentation algorithm (@pxref{SML Mode
 Defaults,,Customising SML Mode}, below).
 
 
-@deffn Command sml-indent-line
+@deffn Command indent-for-tab-command
 Key: @key{TAB}
 @kindex @key{TAB}
 
 This command indents the current line. If you set the indentation of the
-previous line by hand, @code{sml-indent-line} will indent relative to
+previous line by hand, @code{indent-for-tab-command} will indent relative to
 this setting.
 @end deffn
 
 
-@deffn Command sml-indent-region
+@deffn Command indent-region
 Key: @kbd{C-M-\}
 @kindex @kbd{C-M-\}
 
@@ -570,6 +540,15 @@ and the function name copied at the appropriate column. Generally, try
 it whenever a @code{|} is wanted---you'll like it!
 @end deffn
 
+@deffn Command sml-electric-space
+Key: @kbd{M-SPC}
+@kindex @kbd{M-SPC}
+
+When the point is after a keyword like `let', this inserts the
+corresponding predefined skeleton if one exists.  Else it just inserts a
+space.  Another way to insert those skeletons is to use
+@code{sml-insert-form}, described below.
+@end deffn
 
 @deffn Command sml-electric-semi
 Key: @kbd{;}
@@ -580,15 +559,12 @@ governed by the variable @code{sml-electric-semi-mode}.
 @end deffn
 
 
-@defvr {Command, Variable} sml-electric-semi-mode
+@defvr Variable sml-electric-semi-mode
 Default: @code{nil}
 
 If this variable is @code{nil}, @code{sml-electric-semi} just inserts a
 semi-colon, otherwise it inserts a semi-colon and a newline, and indents
-the newline for SML. The command toggles the value of the variable; if
-you give the command a prefix argument (i.e., @kbd{C-u M-x
-sml-electric-semi-mode}) this always disables the electric effect of
-@kbd{;}.
+the newline for SML.
 @end defvr
 
 
@@ -625,134 +601,18 @@ further details.
 
 @noindent
 Several variables try to control the indentation algorithm and other
-features of SML mode. For these user settable variables there is
-generally a function of the same name that does the job---look for them
-in the menu under @emph{Format/Mode Variables}.
-
-
-@defvr {Command, Variable} sml-indent-level
-@findex sml-indent-level
-Default: @code{4}
-
-This variable controls the block indentation level. The command prompts
-for a numeric value unless a numeric prefix is provided instead. For
-example @kbd{M-2 M-x sml-indent-level} will set the variable to 2
-without prompting.
-@end defvr
-
-
-@defvr {Command, Variable} sml-pipe-indent
-@findex sml-pipe-indent
-Default: @code{-2}
-
-This variable adjusts the indentation level for lines that begin with a
-@code{|} (after any white space). The extra offset is usually negative.
-The command prompts for a numeric value unless a numeric prefix is
-provided instead.
-@end defvr
-
-
-@defvar sml-paren-lookback
-Default: @code{1000}
-
-The number of characters the indentation algorithm searches for an
-opening parenthesis. 1000 characters is about 30-40 lines; larger values
-mean slower indentation. If the value of the variable is @code{nil} this
-means the indentation algorithm won't look back at all.
-@end defvar
-
-
+features of SML mode.  Most of them are still in flux so they are not
+described here yet.
 If the default values are not acceptable you can set these variables
 permanently in your @file{.emacs} file. @xref{Configuration}, for
-details and examples. Three further variables control the behaviour of
-indentation.
-
+details and examples.
 
-@defvr {Command, Variable} sml-case-indent
-@findex sml-case-indent
-Default: @code{nil}
-
-How to indent `case' expressions:
 
-@iftex
-@example
-@r{If @code{t}:}                                 @r{If @code{nil}:}
-case expr                           case expr of
-  of exp1 => ...                        exp1 => ...
-   | exp2 => ...                      | exp2 => ...
-@end example
-@end iftex
-@ifinfo
-@example
-If @code{t}:                             If @code{nil}:
-case expr                           case expr of
-  of exp1 => ...                        exp1 => ...
-   | exp2 => ...                      | exp2 => ...
-@end example
-@end ifinfo
-
-The first seems to be the standard in SML/NJ. The second is the (nicer?)
-default.
-@end defvr
-
-
-@defvr {Command, Variable} sml-nested-if-indent
-@findex sml-nested-if-indent
-Default: @code{nil}
-
-Nested `if-then-else' expressions have the following indentation
-depending on the value.
-
-@iftex
-@example
-@r{If @code{t}:}                               @r{If @code{nil}:}
-if exp1 then exp2                 if exp1 then exp2          
-else if exp3 then exp4            else if exp3 then exp4     
-else if exp5 then exp6                 else if exp5 then exp6
-     else exp7                              else exp7       
-@end example
-@end iftex
-@ifinfo
-@example
-If @code{t}:                           If @code{nil}:
-if exp1 then exp2                 if exp1 then exp2          
-else if exp3 then exp4            else if exp3 then exp4     
-else if exp5 then exp6                 else if exp5 then exp6
-     else exp7                              else exp7       
-@end example
-@end ifinfo
-@end defvr
-
-
-@defvr {Command, Variable} sml-type-of-indent
-@findex sml-type-of-indent
-Default: @code{t}
-
-Determines how to indent `let', `struct', etc..
-
-@iftex
-@example
-@r{If @code{t}:}                               @r{If @code{nil}:}
-fun foo bar = let                 fun foo bar = let
-                  val p = 4           val p = 4    
-              in                  in               
-                  bar + p             bar + p      
-              end                 end              
-@end example
-@end iftex
-@ifinfo
-@example
-If @code{t}:                           If @code{nil}:
-fun foo bar = let                 fun foo bar = let
-                  val p = 4           val p = 4    
-              in                  in               
-                  bar + p             bar + p      
-              end                 end              
-@end example
-@end ifinfo
+@defvr Variable sml-indent-level
+@findex sml-indent-level
+Default: @code{4}
 
-@code{sml-type-of-indent} will not have any effect if the starting
-keyword is the first word on the line.
+This variable controls the block indentation level.
 @end defvr
 
 @c end vtable
@@ -786,7 +646,7 @@ Defaults}, for some hints.
 
 @findex inferior-sml-mode
 @code{inferior-sml-mode} is a specialisation of the @file{comint}
-package that comes with GNU Emacs and GNU XEmacs.
+package that comes with Emacs and XEmacs.
 
 
 @menu
@@ -858,12 +718,6 @@ set this in your @file{.emacs} with, e.g.:
 (setq sml-program-name "nj-sml")
 @end lisp
 
-@noindent
-You probably shouldn't set this in @code{sml-mode-hook} because that
-will interfere if you occasionally run a different compiler (e.g.,
-@code{poly} or @code{hol90}).
-
-
 
 @deffn Command run-sml
 Launches ML as an inferior process in another buffer; if an ML process
@@ -913,16 +767,6 @@ directory to be changed, if the compiler can do this. The variable
 @end deffn
 
 
-
-@c @findex inferior-sml-mode
-@c It's unlikely you will ever need this, but @code{inferior-sml-mode} is
-@c the command that will put the current buffer into ML interaction mode.
-@c Note that if you try @kbd{C-c C-s} before an ML process has been
-@c started, you'll just get an error message to the effect that there's no
-@c current process buffer.
-
-
-
 @c ======================================================== SENDING TEXT
 
 @node ML Interaction, Tracking Errors, Running ML, Interaction Mode
@@ -962,24 +806,6 @@ Send the current region of text in the SML buffer.
 SML mode if you wish: it'll send the region and then switch-to-sml.
 @end deffn
 
-@deffn Command sml-drag-region
-Key: @kbd{M-S-down-mouse-1}
-@kindex @kbd{M-S-down-mouse-1}
-
-It's sometimes irritating to do all that @kbd{C-@@} and @kbd{C-c C-r}
-stuff to send regions to the ML process, so if you are running Emacs
-under X Windows (say) you can do the same job by holding down both the
-@key{SHIFT} and @key{META} keys, and dragging with mouse button one over
-the region. This will temporarily highlight the region as you move the
-mouse, like @code{mouse-drag-region} (i.e., @kbd{down-mouse-1}),
-and send the highlighted text straight into the jaws of the ML compiler.
-
-If you only click the mouse button, instead of dragging, the region of
-text sent to the compiler is delimited by the current position of point
-and the place where you click the mouse. In neither case will the
-command set the region.
-@end deffn
-
 @c @deffn Command sml-send-function
 @c @findex sml-send-function-and-go
 
@@ -997,53 +823,6 @@ Key: @kbd{C-c C-b}
 Send the contents of the current buffer to ML.
 @end deffn
 
-@c Two further commands are defined for you to bind to keys if you wish:
-@c @code{sml-send-region-and-go} and @code{sml-send-function-and-go}. Both
-@c automatically switch to the interaction buffer.
-
-
-By and large, Emacs can nowadays quite happily send large chunks of text
-to its subprocesses (@file{comint} does input splitting). However, it is
-still probably safest@footnote{XEmacs 19.11 users are warned that
-changing the default @code{sml-temp-threshold} may well cause XEmacs to
-hang; they seem to have fixed the problem in 19.12 and above.} to send
-larger program fragments to ML via the temporary file mechanism. This,
-for @code{sml-send-region} and other SML mode commands that use it
-in some way, takes advantage of the ML compiler's ability to open a file
-and compile the contents by making a temporary file of the indicated
-text. Two variables of interest are:
-
-
-@defvar sml-temp-threshold 
-Default: @code{0}
-
-Determines what constitutes a large program fragment. A value of 512,
-say, will declare half a kilobyte a suitable threshold and larger
-fragments will be sent via a temporary file. A value of 0 means
-@emph{all} text is sent via a temporary file; the value @code{nil}
-inhibits the temporary file mechanism altogether.
-@end defvar
-
-
-@defvar sml-temp-file 
-Default: @code{(make-temp-name "/tmp/ml")}
-
-A string that gives the name of the temporary file to use. This
-default ensures Emacs will invent a unique name for this purpose for
-use throughout the rest of the editing session. Only one temporary
-file is used. 
-@end defvar
-
-
-Another reason, you might well say @emph{the reason}, for using the
-temporary file mechanism is that error messages reported by the ML
-compiler (@pxref{Tracking Errors}) are generally useless to SML mode
-unless a real file is associated with the input (an embedded @emph{use
-file} will count as a real file). Of course, this all rather depends on
-the compiler producing sensible error messages, and on SML mode
-being able to parse them.
-
-
 @c ===================================================== TRACKING ERRORS
 
 @node Tracking Errors, Process Defaults, ML Interaction, Interaction Mode
@@ -1061,54 +840,17 @@ one of the mechanisms provided for sending programs directly to the
 compiler---@pxref{ML Interaction}.
 
 
-@deffn Command sml-next-error
-@findex sml-skip-errors
-Key: @kbd{C-c`}
-@kindex @kbd{C-c`}
+@deffn Command next-error
+@findex next-error
+Key: @kbd{C-x`}
+@kindex @kbd{C-x`}
 
 Jump to the source location of the next error reported by the compiler.
-If the function bound to @code{sml-error-parser} returns a range of
-character positions for the location of the error in the source file,
-@code{sml-next-error} will put the mark at the end of the range with
-point at the beginning; it may also highlight the region specified; it
-will also echo the one-line text of the error message if the error
-parser returns one.@footnote{Does @code{sml-error-parser} return these
-nice things? The answer is complicated! @xref{Advanced Topics}, and the
-docstring @kbd{C-h v sml-error-parser}.}
-
-If you enter @kbd{C-u C-c`} instead, the command (a.k.a.@:
-@code{sml-skip-errors}) skips past all the remaining error messages and
-removes any error overlay in the current buffer. Note that @kbd{C-c`}
-also works in the ML interaction buffer (by default).
+All the usual error-navigation commands are available, see
+@pxref{Compilation Mode, , , emacs, The Emacs Editor Manual}.
 @end deffn
 
 
-@defvr {Variable, Command} sml-error-overlay
-@findex sml-error-overlay
-Default: @code{t}
-
-Legal default values for this buffer-local variable are @code{t} and
-@code{nil}. The variable attains a local value in each SML mode
-buffer when the default is @code{t}; in this case the local value is an
-overlay (or @emph{extent} in XEmacs speak), and this means
-@code{sml-next-error} will highlight errors in the buffer when it can.
-If the default is @code{nil} it stays that way and @code{sml-next-error}
-will not highlight anything, ever.
-
-The command @kbd{M-x sml-error-overlay} will set the overlay around the
-current region, or remove the overlay if a prefix argument is given
-(i.e., @kbd{C-u M-x sml-error-overlay} removes the overlay, but this
-functionality can be accessed from the menu to save typing).
-@end defvr
-
-
-Note that SML mode will usually locate errors relative to the start
-of the last major program fragment sent to the compiler (via
-@code{sml-load-file}, etc.), but if you don't use the temporary file
-mechanism to communicate text to the ML process (@pxref{Process
-Defaults}), errors will generally not be located at all.
-
-
 @c ==================================================== PROCESS DEFAULTS
 
 @node Process Defaults, , Tracking Errors, Interaction Mode
@@ -1123,9 +865,7 @@ deliberately, so SML mode will work with a variety of ML compilers
 and ML-based tools. There are therefore a number of variables that may
 need to be set correctly before SML mode can speak to the compiler.
 Things are by default set up for Standard ML of New Jersey, but
-switching to a new system is quite easy---very easy if you are using
-Poly/ML or Moscow ML as these are supported by libraries bundled with
-SML mode.
+switching to a new system is quite easy.
 
 
 
@@ -1148,7 +888,7 @@ should.
 
 
 @defvar sml-prompt-regexp
-Default: @code{"^[\-=] *"}
+Default: @code{"^[-=>#] *"}
 
 Matches the ML compiler's prompt: @file{comint} uses this for various
 purposes.
@@ -1156,38 +896,22 @@ purposes.
 
 
 To customise error reportage for different ML compilers you need to set
-two further variables before @code{sml-next-error} can be useful:
+two further variables before @code{next-error} can be useful:
 
 
-@defvar sml-error-regexp
-Default: @code{sml-smlnj-error-regexp}
+@defvar sml-error-regexp-alist
 
-This is the regular expression for matching the start of an error
-message. The default matches the Standard ML of New Jersey compiler's
-Error and Warning messages. If you don't want stop at Warnings try, for
-example:
-@example
-  "^[-= ]*.+:[0-9]+\\.[0-9]+.+Error:"
-@end example
-If you're using Edinburgh (core) ML try @code{"^Parse error:"}.
+Alist that specifies how to match errors in compiler output.
+Each elt has the form (REGEXP FILE-IDX LINE-IDX [COLUMN-IDX FILE-FORMAT...])
+If REGEXP matches, the FILE-IDX'th subexpression gives the file name, and
+the LINE-IDX'th subexpression gives the line number.  If COLUMN-IDX is
+given, the COLUMN-IDX'th subexpression gives the column number on that line.
+If any FILE-FORMAT is given, each is a format string to produce a file name to
+try; %s in the string is replaced by the text matching the FILE-IDX'th
+subexpression.
 @end defvar
 
 
-@defvar sml-error-parser 
-Default: @code{'sml-smlnj-error-parser}
-
-The function that actually parses the error message. Again, the default
-is for SML/NJ. If you need to change this you may have to do a little
-Emacs Lisp programming.
-@end defvar
-
-
-Note that bundled libraries supply an @code{sml-mosml-error-parser} and
-an @code{sml-poly-ml-error-parser}, and set all the attendant compiler
-variables. @xref{Advanced Topics}, for tips on how to program your own
-compiler extension to SML mode.
-
-
 @c A typical way of (re)setting these variables correctly is to put
 @c something in your @file{.emacs} file that resembles
 
@@ -1196,67 +920,23 @@ compiler extension to SML mode.
 @c (setq sml-prompt-regexp "^[>#] *")
 @c @end example
 
-@c @noindent
-@c probably on @code{inferior-sml-load-hook} (but @pxref{Configuration},
-@c first).
-
-
 @c ======================================================= CONFIGURATION
 
-@node Configuration, Credits, Interaction Mode, Top
+@node Configuration, , Interaction Mode, Top
 
 @chapter Configuration Summary
 
-@c == Configuration, Credits, Interaction Mode, Top ===================
-
 @c @footnote{@url{http://www.ahl.co.uk/}}
 @c @footnote{@url{http://www.dina.kvl.dk/~sestoft/mosml.html}}
 
 @noindent
 This (sort of pedagogic) section gives more information on how to
 configure SML mode: menus, key bindings, hooks and highlighting are
-discussed, along with a few other random topics. First, though, the
-auxiliary files @file{sml-poly-ml.el} and @file{sml-mosml.el} define
-defaults for these popular (?) ML compilers---Poly/ML and Moscow ML,
-respectively. One way to setup SML mode to use Moscow ML is to add
-to your @file{.emacs}:
-
-@example
-(defun my-mosml-setup () "Initialise inferior SML mode for Moscow ML."
-  (load-library "sml-mosml.el")
-  (setq sml-program-name "/home/mjm/mosml/bin/mosml"))
-(add-hook 'inferior-sml-load-hook 'my-mosml-setup)
-@end example
-
-@noindent 
-which creates a hook function @code{my-mosml-setup} and adds it to
-@code{inferior-sml-load-hook} so that the defaults for
-@code{sml-error-regexp} and its ilk (@pxref{Process Defaults}) are
-correctly initialised; I have to set @code{sml-program-name} explicitly
-here because that directory isn't on my (Unix) PATH. The story is
-similar if you use Poly/ML.
-Note, by the way, that order matters here: the @code{load-library} call
-comes first because the default for @code{sml-program-name} in
-@file{sml-mosml.el} is just @code{"mosml"}. 
-
-@c @example
-@c (eval-after-load "sml-proc" '(my-mosml-setup))
-@c @end example
-@c @noindent
-@c is perhaps a better way to achieve the same effect, but last time I
-@c looked this wouldn't work in XEmacs.
-
-The auxiliary libraries bundled with SML mode define commands
-@code{sml-mosml} and @code{sml-poly-ml} (there's also an
-@code{sml-smlnj} for uniformity); these commands prompt for suitable
-values for @code{sml-program-name} and @code{sml-default-arg} before
-starting the compiler and setting the other process defaults. A prefix
-argument will give you the builtin defaults with no questions asked.
+discussed, along with a few other random topics.
 
 @menu
 * Hooks::               Creating them
 * Key Bindings::        Binding commands to keys
-* Menus::               Taking advantage of bitmapped screens
 * Highlighting::        Syntax colouring
 * Advanced Topics::     You may need to speak Emacs Lisp
 @end menu
@@ -1284,7 +964,7 @@ Defaults,,Indentation Defaults}), and other defaults, is through the
 (add-hook 'sml-mode-hook 'my-sml-mode-hook)
 @end lisp
 @noindent
-The body of @code{my-sml-mode-hook} is a sequence of bindings. In this
+The body of @code{my-sml-mode-hook} is a sequence of assignments. In this
 case it is not really necessary to set @code{sml-indent-level} in a hook
 because this variable is global (most SML mode variables are). With
 similar effect:
@@ -1293,20 +973,10 @@ similar effect:
 (setq sml-indent-level 2)
 @end lisp
 @noindent
-anywhere in your @file{.emacs} file (but probably on
-@code{sml-load-hook}). The variable @code{indent-tabs-mode} is
+anywhere in your @file{.emacs} file. The variable @code{indent-tabs-mode} is
 automatically made local to the current buffer whenever it is set
 explicitly, so it @emph{must} be set in a hook if you always want
-SML mode to behave like this. The same goes for the buffer-local
-@code{sml-error-overlay}; since this is globally @code{t} by default,
-set it globally @code{nil} if you never want errors highlighted:
-
-@lisp
-(setq-default sml-error-overlay nil)
-@end lisp
-@noindent
-Again, on @code{sml-load-hook} would probably be the best place.
-
+SML mode to behave like this.
 
 Another hook is @code{inferior-sml-mode-hook}. This can be used to
 control the behaviour of the interaction buffer through various
@@ -1320,7 +990,7 @@ variables meaningful to @file{comint}-based packages:
 (add-hook 'inferior-sml-mode-hook 'my-inf-sml-mode-hook)
 @end lisp
 @noindent
-Again, the body is a sequence of bindings. Unless you run several ML
+Again, the body is a sequence of assignments. Unless you run several ML
 compilers simultaneously under one Emacs, this hook will normally only
 get run once. You might want to look up the documentation (@kbd{C-h v}
 and @kbd{C-h f}) for these buffer-local @code{comint} things.
@@ -1328,13 +998,10 @@ and @kbd{C-h f}) for these buffer-local @code{comint} things.
 
 @c ======================================================== Key Bindings
 
-@node Key Bindings, Menus, Hooks, Configuration
+@node Key Bindings, Highlighting, Hooks, Configuration
 
 @section Key bindings
 
-@c == Key Bindings, Menus, Hooks, Configuration ========================
-
-
 @noindent
 Customisation (in Emacs) usually entails putting favourite commands on
 easily remembered keys. Two `keymaps' are defined in SML mode: one
@@ -1351,14 +1018,12 @@ are global (variables):
 
 @lisp
 (defun my-sml-load-hook () "Global defaults for SML mode"
-  (define-key   sml-mode-map "\C-cd" 'sml-cd)
-  (define-key   sml-mode-map "\C-co" 'sml-error-overlay))
+  (define-key   sml-mode-map "\C-cd" 'sml-cd))
 (add-hook 'sml-load-hook 'my-sml-load-hook)
 @end lisp
 @noindent
-This has the effect of binding @code{sml-cd} to the key @kbd{C-c d}, and
-the command @code{sml-error-overlay} to the key @kbd{C-c o}. If you want
-the same behaviour from @kbd{C-c d} in the ML buffer:
+This has the effect of binding @code{sml-cd} to the key @kbd{C-c d}.
+If you want the same behaviour from @kbd{C-c d} in the ML buffer:
 
 @lisp
 (defun my-inf-sml-load-hook () "Global defaults for inferior SML mode"
@@ -1374,44 +1039,12 @@ course: SML mode won't define @code{sml-mode-map} or
 @code{inferior-sml-mode-map} if you have already done so. 
 
 
-@c =============================================================== Menus
-
-@node Menus, Highlighting, Key Bindings, Configuration
-
-@section Menus
-
-@c == Menus, Highlighting, Key Bindings, Configuration =================
-
-
-@noindent
-Menus are useful for fiddling with mode defaults and finding out what
-keys commands are on if you are forgetful (not all commands are listed
-in the menu). For menus to appear in the menu bar under GNU Emacs or GNU
-XEmacs, the editor must be able to find one of two packages---i.e., one
-or both must be on your @code{load-path}. The first option is
-@file{easymenu} which is distributed with GNU Emacs. Easy!
-
-The second option is @file{auc-menu} which was written by Per Abrahamsen
-and distributed with AUCTeX, but it is independently available from the
-IESD lisp archive@footnote{@url{ftp://sunsite.auc.dk/packages/auctex/}}
-at Aalborg. You'll also find @file{auc-menu} is available from the LCD
-archive@footnote{@url{ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/misc/}},
-the main repository for all Emacs Lisp. The advantage of @file{auc-menu}
-is that it works with XEmacs too.
-
-Notice that certain menu entries are not illuminated at first---these
-are generally functions that depend on there being an ML process running
-with which to communicate.
-
-
 @c ======================================================== Highlighting
 
-@node Highlighting, Advanced Topics, Menus, Configuration
+@node Highlighting, Advanced Topics, Key Bindings, Configuration
 
 @section Syntax colouring
 
-@c == Highlighting, Advanced Topics, Menus, Configuration ==============
-
 
 @noindent
 Highlighting is very handy for picking out keywords in the program text,
@@ -1419,50 +1052,22 @@ spotting misspelled kewyords, and, if you have Emacs' @file{ps-print}
 package installed (you usually do these days), obtaining pretty, even
 colourful code listings---quite properly for your colourful ML programs.
 
-@vindex sml-font-lock-extra-keywords
-@vindex sml-font-lock-auto-on
-
-Various highlight (hilite, if you spell real bad!) packages are
-available for GNU Emacs 19, and GNU XEmacs. SML mode can use either
-@file{hilit19} which only comes with Emacs, or @file{font-lock} which is
-the package of choice with XEmacs. If you are not familiar with these
-highlight packages you'll have to check their sources for installation
-guidelines, etc..
-
-Use @code{sml-load-hook} to tell Emacs which scheme you prefer for
-SML mode. For example:
-
-@lisp
-(add-hook 'sml-load-hook '(lambda () (require 'sml-font)))
-@end lisp
-
-@noindent
-This ensures the SML extensions to @file{font-lock} will be available
-once SML mode loads (from @file{sml-font.el}---if you prefer
-@file{hilit19} you should @code{(require 'sml-hilite)} instead.
-
-The variable @code{sml-font-lock-extra-keywords} is for further
-customising @file{font-lock} for SML mode. The value of the variable
-should be a list of strings, each of which is a regular expression that
-should match the desired keyword exactly. Here's an example:
+The indentation scheme (strangely enough) also relies on the
+highlighting code to properly handle nested comments, which is yet
+another reason to turn on highlighting.  To turn on highlighting,
+use either of:
 
 @lisp
-(setq sml-font-lock-extra-keywords 
-      '("\\babstraction\\b" "\\bfunsig\\b" "=>" "::"))))
+M-x font-lock-mode
+(add-hook 'sml-mode-hook 'turn-on-font-lock)
+(global-font-lock-mode 1)
 @end lisp
 
-@noindent
-The @code{\b} marks a word boundary, according to the syntax table
-defined for SML mode. Backslash must be quoted inside a string.
-@xref{Regexps,,,emacs,The Emacs Editor Manual}, for a summary of Emacs'
-regular expression syntax. 
-
-
-Finally, the variable @code{sml-font-lock-auto-on} can be used to
-control whether or not @file{font-lock} should be enabled by default in
-SML mode buffers; it is enabled by default. The @code{sml-hilite}
-package is customisable, but only with regard to colour changes.
-
+The first will turn it on in the current buffer.
+The second will turn it on in all sml-mode buffers.
+The last will turn it on everywhere.
+This is valid for Emacs but maybe not for XEmacs.  Check font-lock
+documentation if you encounter problems.
 
 @c ===================================================== ADVANCED TOPICS
 
@@ -1470,18 +1075,6 @@ package is customisable, but only with regard to colour changes.
 
 @section Advanced Topics
 
-@c == Advanced Topics, , Highlighting, Configuration ===================
-
-@menu
-* Forms::    These forms are bloody useless; can't we have better ones?
-* Indents::  I hate that indentation algorithm; can't I suppress it?
-* Multi ML:: Can SML mode handle more than one compiler running at once?
-* Other ML:: What needs to be done to support other ML compilers?
-@end menu
-
-
-@node Forms, Indents, Advanced Topics, Advanced Topics
-
 @flushright
 @emph{These forms are bloody useless; can't we have better ones?}
 @end flushright
@@ -1502,57 +1095,42 @@ to add @code{NAME} to @code{sml-forms-alist} permanently yourself:
 @lisp
 (defun my-sml-load-hook () "Global defaults for SML mode"
   ;; whatever else you do
-  (setq sml-forms-alist (cons '("NAME") sml-forms-alist)))
+  (add-to-list 'sml-forms-alist '("NAME" . FUNCTION)))
 @end lisp
 
 If you want to create templates like `case' that prompt for parameters
-you'll have to do some Lisp programming. The @code{tempo} package looks
-like a good stating point. You can always overwrite your own macros, but
-the builtin forms for `let', etc., can't be overwritten.
+you'll have to do some Lisp programming. The @code{skeleton} package is
+a good stating point.  Better yet, you can reuse the wrappers used by
+sml-mode itself in your sml-load-hook:
 
+@lisp
+(add-hook 'sml-load-hook
+  (lambda ()
+    (sml-def-skeleton "case" "Case expr: "
+      str " of" \n _ " => ")))
+@end lisp
 
-@node Indents, Multi ML, Forms, Advanced Topics
+This will redefine `case' in order to leave the `of' on the first line.
+See the documentation of @code{skeleton-insert} to get a better
+understanding of how this works.
 
 @sp 1
 @flushright
-@emph{I hate that indentation algorithm; can't I suppress it?}
+@emph{I hate that indentation algorithm; can't I tweak it?}
 @end flushright
 
 @sp 1
 @noindent
-Ah, yes, a common complaint. It's actually very easy to use SML mode
-without the troublesome @code{sml-indent-line}:
-
-@lisp
-(defun my-sml-load-hook () "Global defaults for SML mode"
-  ;; whatever else you do
-  (fset 'sml-indent-line 'ignore))
-@end lisp
-@noindent
-though @code{indent-relative-maybe} may conceivable be more useful than
-@code{ignore}.
+Ah, yes, of course, but this manual will not tell you how.
 
 
-@node Multi ML, Other ML, Indents, Advanced Topics
-
 @sp 1
 @flushright
 @emph{Can SML mode handle more than one compiler running at once?}
 @end flushright
 
-@findex sml-buffer
-@vindex sml-buffer
-@sp 1
-@noindent
-The question is whether you can! See the @code{sml-buffer} variable's
-on-line help (@kbd{C-h v sml-buffer}). Note that the SML mode
-compiler variables (@pxref{Process Defaults}) are all buffer-local, so
-you can even switch between different ML compilers, not just different
-invocations of the same one. Well, you @emph{can}.
-
-
-
-@node Other ML, , Multi ML, Advanced Topics
+Sure, just rename the @samp{*sml*} buffer and then use @code{run-sml}
+as usual.
 
 @sp 1
 @flushright
@@ -1561,117 +1139,18 @@ invocations of the same one. Well, you @emph{can}.
 
 @sp 1
 @noindent
-Not that much really, at least not to create minimal support. The
-interface between SML mode and the compiler is determined by the
-variables
-@code{sml-use-command},
-@code{sml-cd-command},
-@code{sml-prompt-regexp}
-(which are easy to get right), and
-@code{sml-error-regexp}, and
-@code{sml-error-parser} (which are more tricky). 
-The general template to follow in setting this up
-is in the files @file{sml-@{poly-ml,mosml@}.el}.
-These rules will not change, I hope:
+Not much really.  Just add the right regular expressions to
+@code{sml-error-regexp-alist} and that should be all.
 
-@itemize @bullet
-@item
-@code{sml-next-error} uses @code{sml-error-regexp} to locate the start
-of the next error report in the ML interaction buffer (@var{P})
-
-@item
-@code{sml-next-error} calls @code{sml-error-parser}, passing @var{P}, and
-expects up to five return values in this order:
-
-@enumerate
-@item file name in which the error occurs (@var{F})
-@item start line of the error (@var{L} > 0)
-@item start column of the error (@var{C})
-@item an Emacs Lisp expression to be @code{eval}'d 
-at (@var{L},@var{C}) in @var{F} (@var{EOE})
-@item the actual text of the one-line error report (@var{MSG})
-@end enumerate
-
-
-@item 
-@code{sml-error-parser} can assume that @var{P} is the start of the next
-error message that the user is interested in---since she defines this
-point by defining @code{sml-error-regexp}.
-
-@item
-What @code{sml-error-parser} returns is a list. In the event of problems,
-I foresee the following needs:
-
-@itemize -
-@item if the file is the standard input,
-return @code{("std_in" @var{L} @var{C})}
-@item if the file cannot be inferred,
-return @code{(nil @var{L} @var{C})}
-@item if @var{L}=0, or the start cannot be inferred,
-return @code{(@var{F} nil @var{C})}
-@item if the start column cannot be inferred,
-return @code{(@var{F} @var{L} 1)}
-@end itemize
-@end itemize
-
-There's no need to return anything else. However, if you do want the
-errorful text in @var{F} highlighted you should return a simple Lisp
-expression in the fourth argument that'll compute the region. @var{EOE}
-will be called with point at character (@var{L},@var{C}) in @var{F}, and
-should move point to the end of the errorful text. In fact, @var{EOE}
-can actually do anything you wish, but in the simplest cases it'll just
-@code{(forward-char 45)}, or
-
-@lisp
-(progn (forward-line 4) (forward-char 37))
-@end lisp
-@noindent
-etc.. If it does more, make sure it leaves point at the end of the
-region in @var{F}---use @code{save-excursion} if switching buffers.
-@var{MSG}, if returned, will be echoed in the minibuffer.
-
-@c ============================================================== CREDIT
-
-@c H A C K   A T T A C K   O N 
-@c page
-@c H A C K   A T T A C K   O F F
-
-@node Credits, Command Index, Configuration, Top
-
-@unnumbered Credit & Blame
-
-@c == Credits, Command Index, Configuration, Top =======================
-
-@noindent
-SML Mode was written originally by Lars Bo Nielsen for Emacs 18.5n;
-later hacked for comint by Olin Shivers (who called it @t{ml-mode});
-much later hacked by myself because it didn't seem to work@dots{} Fritz
-Knabe brilliantly posted the @code{hilit19} and @code{font-lock}
-functions on the net. Lars probably would recognise much of what
-remains, yet now there're menus, syntax highlighting, support for
-various ML compilers, Texinfo (hey!), and more than a little hope it'll
-work with a variety of Emacs 19s. But there are still things to do. Lars
-wrote:
-@quotation
-@emph{The indentation algorithm still can be fooled. I don't know if it will
-ever be 100% right, as this means it will have to actually parse all of
-the buffer up to the actual line [@dots{}].}
-@end quotation
-@noindent
-This is still the main cause of grief; SML's syntax is a nightmare for
-Emacs modes, and of course opinions vary about proper indentation. But
-there may be something we can do@dots{}
 
 @c ======================================================= COMMAND INDEX
 
 @headings singleafter
 
-@node Command Index, Variable Index, Credits, Top
+@node Command Index, Variable Index, , Top
 
 @unnumbered Command Index
 
-@c == Command Index, Variable Index, Credits, Top ======================
-
 @printindex fn
 
 @c ====================================================== VARIABLE INDEX
index fbbf417865a13d4910313eaa85b29a7bb844cbd3..0838bda2f07d45f95c52d744761dfa36f4a16510 100644 (file)
@@ -189,7 +189,7 @@ specified when running the command \\[sml-cd].")
   :group 'sml-proc
   :type '(regexp))
 
-(defconst sml-error-regexp-alist
+(defvar sml-error-regexp-alist
   '(;; Poly/ML messages
     ("\\(Error\\|Warning:\\) in '\\(.+\\)', line \\([0-9]+\\)" 2 3)
     ;; Moscow ML
@@ -198,7 +198,9 @@ specified when running the command \\[sml-cd].")
     ;; pathological behavior with very long lines.
     ("^[-= ]*\\(.+\\):\\([0-9]+\\)\\.\\([0-9]+\\)\\(-\\([0-9]+\\)\\.\\([0-9]+\\)\\)? \\(Error\\|Warning\\): .*" 1 sml-make-error 2 3 5 6)
     ;; SML/NJ's exceptions:  see above.
-    ("^ +\\(raised at: \\)?\\(.+\\):\\([0-9]+\\)\\.\\([0-9]+\\)\\(-\\([0-9]+\\)\\.\\([0-9]+\\)\\)" 2 sml-make-error 3 4 6 7)))
+    ("^ +\\(raised at: \\)?\\(.+\\):\\([0-9]+\\)\\.\\([0-9]+\\)\\(-\\([0-9]+\\)\\.\\([0-9]+\\)\\)" 2 sml-make-error 3 4 6 7))
+  "Alist that specifies how to match errors in compiler output.
+See `compilation-error-regexp-alist' for a description of the format.")
 
 ;; font-lock support
 (defconst inferior-sml-font-lock-keywords
@@ -407,7 +409,6 @@ This usually updates `sml-buffer' to a buffer named *CMD*."
                    (sml-args-to-list (substring string pos
                                                 (length string)))))))))
 
-;;;###autoload 
 (defun switch-to-sml (eob-p)
   "Switch to the ML process buffer.
 With prefix argument, positions cursor at point, otherwise at end of buffer."
@@ -419,7 +420,6 @@ With prefix argument, positions cursor at point, otherwise at end of buffer."
 
 ;; Fakes it with a "use <temp-file>;" if necessary.
 
-;;;###autoload 
 (defun sml-send-region (start end &optional and-go)
   "Send current region to the inferior ML process.
 Prefix argument means switch-to-sml afterwards.
@@ -462,7 +462,6 @@ If it's loaded into a buffer that is in one of these major modes, it's
 considered an ML source file by `sml-load-file'. Used by these commands
 to determine defaults.")
 
-;;;###autoload 
 (defun sml-send-buffer (&optional and-go)
   "Send buffer to inferior shell running ML process. 
 With a prefix argument switch to the sml buffer as well
@@ -527,7 +526,6 @@ undisturbed once this operation is completed."
   "Caches the (directory . file) pair used in the last `sml-load-file'
 or `sml-cd' command. Used for determining the default in the next one.")
 
-;;;###autoload 
 (defun sml-load-file (&optional and-go)
   "Load an ML file into the current inferior ML process. 
 With a prefix argument switch to sml buffer as well.