                        Gnu-Emacs TAGS support for SML

The following elisp files are included:
  completing-tag.el     simple-sml-mode.el      x-buffer-local-mouse.el
  mouse-tags.el         sml-tags.el

The gnu-emacs tags package works for many languages in the same manner:
  (1) a TAGS file is created for a set of source programs by running a separate
program,
  (2) during a gnu-emacs session, one can visit a TAGS file, which will set up
a tags table that indexes identifiers within the set of source files,
  (3) one can ask for the definition of a tag (identifier), and gnu-emacs
uses the tags table to put the file and proper line on the screen.

Once the TAGS file is created it can be used in any gnu-emacs invocation.
Most of the standard tags functions (find-tag, completing-find-tag, next-tag)
will work with SML tags.  However, since SML is case sensitive there are some
functions modified for sml.  The file sml-tags.el contains functions
sml-visit-tags-table, sml-tags-apropos, and sml-toggle-case-fold.  The
function visit-sml-tags-file works like visit-tags-file, except it make the
tags searches case sensitive (it sets case-fold-search = nil for the TAGS
buffer).

There may be multiple definitions for a single tag.  The function next-tag
will find the next alternate definition of last tag specified.  The function
find-tag is bound to meta-period.  You can bind next-tag to meta-comma as
follows:
  (global-set-key "\e," 'next-tag)

In addition, there is support for using the mouse to find tags.  The functions
x-find-tag, and x-find-tag-other are defined in the file mouse-tags.el.

After binding these functions to mouse/key combinations you can point
to a name and it will do a find-tag on the name it matches around the mouse
location.  The problem is finding unused mouse/key combinations*.  Perhaps
you are not using control-shift mouse combinations.  Then you could do this:

(define-key mouse-map x-button-c-s-middle 'x-find-tag)
(define-key mouse-map x-button-c-s-right 'x-find-tag-other)

You can point to a name, and hit CTL-SHFT right mouse button, and the
definition for the name will appear in the other window.  CTL-SHFT middle
mouse button will put the definition in the window you are pointing at.

The function sml-tags-apropos asks for a regexp and searches (case
insensitively) the tags table, and lists all entries that match the regexp in a
new buffer.  You can then mouse the names in that buffer as described in the
preceeding paragraph.

If you use sml-mode you can set up buffer specific key bindings.  Define
a function that makes these bindings and set the mode hook variable to
that function's symbol.  Then, when sml-mode is entered that function will
be called.
  (defun my-sml-stuff () ...)
  (setq sml-mode-hook 'my-sml-stuff)

There is also a major mode for editing SML source code that is simpler than
the regular sml-mode called simple-sml-mode loaded with:
  (require 'simple-sml-mode)
It is basically the same as indented text mode, but it allows one to have a
mode-hook function for SML.  You can define your own mode-hook function as
follows:
  (setq simple-sml-mode-hook 'my-sml-stuff)

* The package x-buffer-local-mouse.el enables one to make buffer-specific
mouse bindings. The default mode-hook function for simple-sml-mode checks for
this package and makes buffer-specific mouse bindings for SML buffers.  You
can copy this default function and edit it to make your own buffer-specific
bindings, or if you use the regular sml-mode, you can make a mode-hook
function for sml-mode.  See mouse.txt for details.
