Anonymous avatar Anonymous committed f79416b

New package

Comments (0)

Files changed (24)

+MMM Mode was designed and written by Michael Abraham Shulman
+<viritrilbia@users.sourceforge.net>.  The original inspiration came
+from mmm.el for XEmacs by Gongquan Chen <chen@posc.org>.
+2002-02-24  Steve Youngs  <youngs@xemacs.org>
+
+	* XEmacs package created.
+
+2001-02-23  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* configure.in, mmm-mode.el, mmm-vars.el, version.texi:	Released 0.4.7
+
+2001-02-18  Alan Shutko  <ats@acm.org>
+
+	* mmm-vars.el (mmm-classes-alist): Document new keywords.
+
+	* mmm.texinfo (Region Placement): Document the front-match,
+	back-match and end-not-begin keywords.
+
+	* mmm-class.el (mmm-match-region, mmm-ify): Add front-match &
+	back-match keywords to specify which submatch to treat as the
+	delimiter.  Add end-not-begin key.
+	(mmm-match->point): Add front-match and back-match args.
+
+2001-02-12  Alan Shutko  <ats@acm.org>
+
+	* mmm-mason.el (mmm-mason-end-line,mmm-mason-start-line): Use bolp
+	and eolp.
+
+2001-02-03  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-mode.el, mmm-region.el, mmm-vars.el:
+	Added `mmm-primary-mode' variable so that `major-mode' can be saved.
+
+2001-01-27  Alan Shutko  <ats@acm.org>
+
+	* mmm.texinfo: Added direntry for automated info installation.
+
+2001-01-26  Alan Shutko  <ats@acm.org>
+
+	* configure.in: Use elisp macros from w3 to check for emacs and
+	lisp dir.
+
+	* aclocal.m4: Pulled elisp-related checks from the W3 library, so
+	--with-emacs= will work. 
+
+2001-01-15  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-cmds.el (mmm-insert-by-key):
+	Use match-face and major-mode-preferences.
+
+	* mmm-sample.el (mmm-here-doc-get-mode):
+	Try each word individually first.
+
+	* mmm-utils.el (mmm-format-matches):
+	Removed reference to `count' variable.
+
+	* mmm-sample.el, mmm-univ.el, mmm-utils.el:
+	Allowed language names for preference lookup as "mode names".
+
+	* mmm-vars.el (mmm-set-major-mode-preferences): Added function.
+
+2001-01-14  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-class.el, mmm-utils.el (mmm-format-matches):
+	Changed to allow accessing any subexp, not
+	limited by a numerical value of save-matches.
+
+2001-01-13  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-sample.el, mmm-vars.el: Modified CSS to use preferred mode.
+
+	* mmm-vars.el (mmm-save-local-variables):
+	Added syntax and indentation variables for
+	cc-mode and variants.
+
+	* mmm-vars.el (mmm-major-mode-preferences):
+	Added check for `jde-mode' for Java code.
+
+2001-01-12  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-auto.el: Added ePerl and JSP to autoload.
+
+2001-01-11  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-sample.el: Added ePerl submode class.
+
+	* mmm-mason.el, mmm-sample.el:
+	Modified classes to use preferred mode list.
+
+	* mmm-vars.el, mmm-region.el:
+	Added alist to keep track of user-preferred major modes.
+
+	* mmm-mason.el, mmm-rpm.el, mmm-sample.el:
+	Added flags telling which faces to use for which regions.
+
+	* mmm-class.el, mmm-region.el, mmm-vars.el:
+	Added multiple faces and optional levels of decoration.
+
+2001-01-09  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-vars.el (mmm-save-local-variables):
+	Added `parse-sexp-ignore-comments', which
+	seems to fix indentation in php-mode.
+
+2001-01-08  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-region.el (mmm-update-mode-info):
+	Hacked so `font-lock-keywords-alist' works.
+
+2001-01-05  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm.texinfo: Added set-background example for XEmacs.
+	Added info-dir-entry.
+
+2000-09-29  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-class.el (mmm-apply-class):
+	Rearranged parameters so faces actually work.
+
+2000-09-18  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* configure.in, mmm-vars.el, version.texi: Released 0.4.6
+
+2000-09-17  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* FAQ: Added Q about name capitalization.
+
+2000-09-16  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-compat.el (mmm-keywords-used): Added `:private'.
+
+2000-09-12  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* FAQ: Added file
+
+2000-09-12  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* Checklist: Added comment about adding files to the distribution.
+
+	* README: Added comment about installing with multiple emacsen.
+
+	* Makefile.am: Added FAQ
+
+	* mmm-mode.el: Created Emacs Lisp Archive Entry
+
+2000-09-05  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm.texinfo: Set MASON_VERSION.
+
+	* mmm-cmds.el (mmm-display-insertion-key):
+	Prevented (nthcdr -1 ...); breaks in XEmacs.
+
+2000-08-29  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-vars.el (mmm-save-local-variables): Added abbrev-mode variables.
+
+	* mmm-region.el (mmm-update-mode-info):
+	Tested against `mmm-set-file-name-for-modes'.
+
+	* mmm-vars.el (mmm-set-file-name-for-modes):
+	Changed to a list for finer control.
+
+2000-08-24  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-region.el (mmm-make-region):
+	Explicitly set keyword defaults in &rest parameter.
+
+	* mmm-class.el (mmm-ify):
+	Explicitly set defaults for keywords in &rest parameter.
+
+2000-08-23  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-region.el, mmm-vars.el (mmm-set-buffer-file-name-p):
+	Added to control file name setting.
+
+	* mmm-vars.el (mmm-save-local-variables):
+	Added `mode-popup-menu' for XEmacs.
+
+	* mmm-region.el (mmm-update-mode-info):
+	Added some tests for XEmacs 20 to prevent
+	errors and unwanted prompts.
+	Cleared modified flag before killing leftover temporary buffers.
+
+2000-08-21  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm.texinfo:
+	Added comments on RPM Spec, File Variables, and Here-documents.
+
+	* mmm-auto.el: Autoloaded `rpm'.
+
+	* mmm-auto.el: Autoloaded `rpm-sh' submode class from mmm-rpm.el.
+
+	* mmm-rpm.el: Added file (contributed by Marcus Harnisch).
+
+2000-08-17  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-vars.el (mmm-never-modes): Added `forms-mode'.
+	
+2000-08-02  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* configure.in, mmm-vars.el, version.texi: Released 0.4.5.
+
+	* mmm-compat.el (mmm-set-font-lock-defaults): Made into a macro.
+
+	* mmm-auto.el: Autoloaded `mmm-ensure-fboundp'.
+
+	* mmm-region.el (mmm-update-mode-info):
+	Used compatibility wrapper for font-lock defaults.
+
+	* mmm-compat.el (mmm-set-font-lock-defaults):
+	Added compatibility wrapper function.
+
+2000-08-01  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* README.Mason, mmm.texinfo:
+	Added comments about `sgml-parent-document'.
+
+	* mmm-utils.el (mmm-ensure-fboundp): Created function.
+
+	* mmm-sample.el (mmm-here-doc-get-mode):
+	Extended to recognize names like TEXT_EOF.
+
+2000-07-29  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* configure.in, mmm-vars.el, version.texi: Released 0.4.4.
+
+	* mmm-class.el (mmm-get-class-spec):
+	Implemented autoloaded submode classes.
+
+	* mmm-vars.el (mmm-add-group): Made subclasses of a group private.
+
+	* mmm-auto.el: Added autoloading of submode classes.
+
+	* mmm-cmds.el (mmm-ify-by-class):
+	Added completion on autoloaded classes.  Excluded
+	private classes from completion.
+
+	* mmm-vars.el (mmm-classes-alist):
+	Updated docstring for new offset values and
+	include- flags.
+
+	* mmm-sample.el (here-doc): Updated to use new front-offset values.
+
+	* mmm-class.el (mmm-ify, mmm-match-region, mmm-match->point):
+	Added new values for front- and back-offset.
+
+	* mmm-region.el (mmm-make-region):
+	Made sure overlays get the delimiter and sticky
+	properties even if they aren't passed explicitly.
+
+2000-07-26  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* configure.in: Changed output name from `mmm' to `mmm-mode'.
+
+2000-07-24  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-sample.el: Updated file-variables class to handle prefixes.
+
+2000-07-23  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-sample.el: Wrote File Variables submode class for the new syntax.
+
+2000-07-21  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-cmds.el (mmm-ify-by-class):
+	Added completion on all defined classes.
+
+	* mmm-sample.el (mmm-here-doc-get-mode):
+	Signaled non-fboundp here-document names.
+
+	* mmm-univ.el (mmm-univ-get-mode): Signaled error on non-fboundp modes.
+
+	* mmm-class.el (mmm-match-region, mmm-ify):
+	Caught errors from :match-submode.
+
+	* mmm-vars.el: Added `mmm-no-matching-submode' error signal.
+
+	* mmm-sample.el:
+	Allowed here-documents in any mode with :match-submode.
+	Added insertion syntax to here-docs, javascript, and embperl.
+
+2000-07-14  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm.texinfo, version.texi:
+	Added MASON_VERSION variable to keep track of that.
+
+	* mmm.texinfo: Wrote about changing key bindings and local variables.
+	Copied info from documentation of `mmm-classes-alist'.
+
+2000-07-13  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* mmm-vars.el (mmm-run-major-mode-hook):
+	Added `ignore-errors' around each call.
+
+	* mmm-vars.el (mmm-save-local-variables):
+	Changed `defcustom' to `defvar'.
+
+	* mmm.texinfo:
+	Wrote about global classes, highlight, mode line, and hooks.
+
+	* mmm-univ.el: Limited matches to letter/dash strings that are fboundp.
+
+2000-07-12  Michael Abraham Shulman  <viritrilbia@users.sourceforge.net>
+
+	* README.Mason: Added comment about `mmm-global-mode'.
+
+2000-07-12  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* configure.in, mmm-vars.el: Released 0.4.3.
+
+	* mmm-univ.el: Changed %[...]% to [%...%] which looks much nicer.
+
+	* mmm.texinfo: Wrote more about Mason.
+
+	* mmm-mason.el: Moved commentary code to README.Mason.
+
+	* Makefile.am: Added README.Mason to EXTRA_DIST.
+
+	* README.Mason: Created file.
+
+2000-07-11  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm-region.el (mmm-update-mode-info):
+	Used `mmm-make-temp-buffer'.  Put font-lock
+	property directly rather than setting the variable first.
+
+	* mmm-mode.el (mmm-mode-off): Reset font-lock variables.
+
+	* mmm-compat.el (mmm-make-temp-buffer):
+	Added as workaround for make-indirect-buffer.
+
+	* mmm-region.el:
+	(mmm-enable-font-lock, mmm-update-font-lock-buffer, mmm-update-mode-info):
+	Conditioned font-lock usage on mmm-font-lock-available-p.
+
+	* mmm-compat.el (mmm-font-lock-available-p): Added flag.
+
+	* mmm-region.el (mmm-update-mode-info):
+	Killed any lingering temporary buffers.
+
+	* mmm-cmds.el (mmm-insert-by-key):
+	Made inserted regions beg- and end-sticky.
+
+	* mmm-compat.el (mmm-keywords-used): Added :classes.
+
+2000-06-30  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* configure.in, mmm-vars.el: Released 0.4.2a.
+
+	* mmm-region.el: Reordered Inspection and Creation for byte compiler.
+
+	* mmm-mode.el: Moved mmm-mode variable to mmm-vars.el.
+
+	* mmm-auto.el: Added some autoloads.
+
+	* Makefile.am: Added mmm-univ.el.
+
+	* configure.in, mmm-vars.el: Released 0.4.2.
+
+	* mmm-auto.el (mmm-mode-on-maybe):
+	Conditioned font-lock updating on mmm-mode.
+
+	* mmm-region.el:
+	Removed use-local-map advice; no longer necessary (thank goodness!)
+
+	* mmm-region.el, mmm-auto.el: Fixed font-lock woes (hopefully).
+
+	* mmm-class.el: Allowed dynamically specified submodes.
+
+	* mmm-utils.el, mmm-mode.el, mmm-cmds.el:
+	Fixed font-lock woes (hopefully).
+
+	* mmm.texinfo: Added Embperl.
+
+	* mmm-vars.el (mmm-global-classes):
+	Added variable controlling global classes.
+
+	* mmm-univ.el: Created file defining `universal' submode.
+
+	* mmm-sample.el: Added Embperl.
+
+	* mmm-utils.el: Added def-edebug-specs.
+
+2000-06-29  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm-region.el (mmm-fontify-region-list):
+	Saved local variables before moving.
+
+	* mmm-auto.el (mmm-check-changed-buffers): Checked for live buffer.
+
+	* mmm-utils.el (mmm-valid-buffer):
+	Checked against noninteractive and hidden buffers.
+
+	* mmm-auto.el (mmm-check-changed-buffers):
+	Added check against minibuffers.
+
+	* mmm-vars.el (mmm-never-modes): Added `eshell-mode'.
+
+2000-06-28  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* NEWS, configure.in, mmm-vars.el: Released 0.4.1.
+
+	* mmm-region.el (mmm-overlays-in): Added DELIM parameter.
+	(mmm-submode-changes-in): Added strict flags calling overlays-in.
+
+2000-06-27  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* configure.in, mmm-vars.el: Released 0.4.0.
+
+	* NEWS, TODO, mmm-auto.el, mmm-region.el, mmm-vars.el, mmm.texinfo:
+	Changed mmm-global-mode to use post-command-hook method rather than
+	stack-walk method.
+
+	* mmm-region.el:
+	Fixed bug saving variables when creating regions; need to set them first.
+
+	* mmm-region.el: Added creation-hook, fixed mode-name problem.
+
+	* mmm-class.el: Added mmm-[get,set]-class-parameters and creation-hook.
+
+	* mmm-auto.el, mmm-region.el, mmm-vars.el:
+	Fixed bug where font-lock-mode was set to `t' globally, causing
+	global-font-lock-mode to turn it off.
+
+2000-06-26  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm-region.el:
+	Rewrote local variable functions, added new ones, changed updating,
+	fontification, and region creation functions to handle this.
+
+	* mmm-mode.el:
+	Added setting and clearing local variables with mode on and off.
+
+	* mmm-vars.el (mmm-save-local-variables):
+	Added extra parameters for saving type and modes, and updated documentation.
+	Created several variables to save buffer- and region- locals.
+	(mmm-temp-buffer-name): Created variable and changed references.
+
+2000-06-23  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm-vars.el (mmm-save-local-variable):
+	Added comment-line-start-skip for Fortran.
+
+2000-06-13  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm.texinfo: Added comment about (require 'mmm-mason).
+
+2000-06-08  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* configure.in, mmm-vars.el: Released 0.3.10
+
+	* mmm-region.el (mmm-overlays-in):
+	Added checks for point-min and point-max for XEmacs.
+	(use-local-map): Added the advice back in.
+
+	* configure.in, mmm-vars.el: Released 0.3.9.
+
+	* mmm-region.el (use-local-map):
+	Conditioned advice definition on not XEmacs.
+
+2000-05-28  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* .cvsignore:
+	Added info file and auxiliary compilation and texinfo files.
+
+	* .cvsignore: Added configure auxiliary files.
+
+	* .cvsignore: Ignored Makefile.in, Makefile, and configure.
+
+	* COPYING, INSTALL, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex:
+	Added files required by automake.
+
+	* mmm.texinfo, elisp-comp, TODO, README, NEWS, ChangeLog, AUTHORS:
+	Added to CVS (formerly not under RCS).
+
+2000-05-24  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm-auto.el: Pre-added major mode hook to text-mode-hook.
+
+2000-05-19  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm-vars.el (mmm-version): changed to 0.3.8.
+
+2000-05-18  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm-region.el:
+	Moved `require's back to top level for byte-compiling.  Added dummy
+	definition of `mmm-real-use-local-map' to shut up byte compiler.
+
+	* mmm-mode.el, mmm-cmds.el, mmm-class.el:
+	Moved `require's back to top level for byte-compiling.
+
+	* mmm-auto.el: `require'd mmm-vars at top level for byte-compiling.
+
+	* Makefile.am:
+	Added all the elisp files to EXTRA_DIST, since Automake doesn't see
+	them as sources for the distribution.
+
+2000-05-10  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm-mason.el: Fixed bug: # is not allowed in symbols.
+
+	* mmm-mason.el:
+	Changed insertion key of <%doc> to `d' and added insertion of %#
+	comment lines with insertion keys `#' and `3'.
+
+	* mmm-mason.el:
+	Distinguished between Perl sections and pseudo-Perl sections.  The one
+	inserts ; at the beginning for indentation hack, the other doesn't
+	because the Mason syntax doesn't allow it and indentation is generally
+	unnecessary anyway.
+
+	* mmm-cmds.el:
+	Fixed "sub"-insertion specs like <%perl> under <%TAG> not to insert
+	the interactor string.
+
+2000-05-03  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm-mason.el: Added dependencies on mmm-compat and mmm-vars.
+
+2000-04-30  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* configure.in, Makefile.am: New file.
+
+	* mmm-sample.el, mmm-mode.el, mmm-region.el, mmm-auto.el, mmm-class.el, mmm-cmds.el, mmm-mason.el:
+	Changed (progn (require ...)) to (when t (require ...)) because the
+	first is still "top level" for the byte compiler.
+
+	* mmm-region.el:
+	Required font-lock and mmm-auto at top level for byte compilation.
+	Moved local maps to come before updating hooks for byte compilation.
+
+	* mmm-utils.el: Loaded CL at top level for byte-compile.
+
+2000-04-29  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm-mode.el, mmm-region.el, mmm-sample.el, mmm-auto.el, mmm-class.el, mmm-cmds.el, mmm-mason.el:
+	Put all `require's not needed at compile-time into `progn's so the
+	byte-compiler doesn't load them (not at top level).  Only `mmm-compat'
+	and `mmm-utils' need to be loaded at compile-time, since they define
+	macros.
+
+2000-04-27  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* All: Started using RCS.
+
+2000-04-27  Michael Abraham Shulman  <mas@kurukshetra.cjb.net>
+
+	* mmm-sample.el (mmm-javascript-mode): Created customization
+	variable to select mode to use for javascript regions.
+
+2000-03-26  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+
+	* mmm-cmds.el (mmm-get-insertion-spec): Insertion keys now have
+	symbolic names, although they have no definition.
+	(mmm-insertion-help): Command added to give help on insertion
+	keys, the way C-h does for command keys.
+
+	* mmm-vars.el (mmm-get-all-classes): Reversed order, so
+	interactive classes take precedence (for insertion, mainly) over
+	`mmm-classes' which overrides mode/ext classes.
+
+2000-03-24  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+
+	* mmm-vars.el (mmm-command-modifiers, mmm-insert-modifiers):
+	Switched defaults to be the way I think it should be. Users can
+	switch back with `mmm-use-old-command-keys'.
+
+	* README: Created file giving information on inital installation.
+
+	* Makefile: Created makefile to compile elisp files and make info
+	file from texinfo file.
+
+	* mmm-region.el: Gave up on conditional stickiness, since it
+	doesn't work in XEmacs and even FSF Emacs has been being flaky
+	with overlay after-change functions. Detecting ends in global
+	`after-change-functions' will work better anyway.
+
+	* mmm-cmds.el: Renamed from `mmm-inter.el'.
+	(mmm-end-current-region): Added command, with key binding.
+
+	* mmm-vars.el (mmm-classes-alist): Documentation updated for
+	unified submode classes.
+
+	* mmm-class.el (mmm-ify): BEG and END arguments removed; just use
+	FRONT and BACK.
+
+	* mmm-utils.el (mmm-format-matches): Ignores non-string arguments.
+
+	* mmm-class.el (mmm-apply-class): Faces supplied for grouping
+	classes now override those on included classes. Parents will do
+	the same thing.
+
+	* mmm-inter.el: Bound `mmm-parse-block' to C-c % 5 as well.
+	(mmm-reparse-current-region): Added command, with key binding.
+
+	* mmm-insert.el: Deleted file, merging contents (insert by
+	keystrokes) into `mmm-inter.el'. Auto-detection insert will
+	probably go elsewhere.
+
+	* mmm-inter.el (mmm-clear-current-region): Uses `mmm-overlay-at'
+	with `all' inclusion type.
+
+	* mmm-region.el (mmm-overlays-at): Added `all' inclusion type.
+
+	* mmm-class.el (mmm-apply-class, etc.): Submode classes have been
+	unified--no more 'regexp, 'region, 'group, etc.
+
+2000-03-23  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+
+	* mmm-inter.el (mmm-parse-buffer, mmm-parse-region, mmm-parse-block):
+	Added "Operating...done" messages.
+
+	* mmm-region.el (mmm-make-region): Allowed caller to add extra
+	keyword arguments to be stored as overlay properties, anticipating
+	new future submode classes.
+
+	* mmm-update.el (use-local-map): Advised to keep track of changed
+	local maps.
+
+	* mmm-region.el (mmm-overlays-at): Added inclusion of boundary
+	points based on endpoint stickiness.
+	(mmm-match-front, mmm-match-back): Front and back overlay
+	properties can now be functions rather than regexps, in
+	anticipation of new future submode classes.
+
+2000-03-22  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+
+	* mmm-utils.el (mmm-valid-buffer): Renamed and added checking for
+	"never" modes.
+
+	* mmm-vars.el (mmm-never-modes): Added, to prevent "temporary
+	shell-mode buffers" and other unnecessariness.
+
+	* mmm-region.el (mmm-overlays-in): Fixed strictness so it doesn't
+	try to match delimiters of non-mmm overlays.
+
+	* mmm-update.el (mmm-local-maps-alist): Keep track of changed
+	local maps by buffer and major mode.
+	(mmm-update-submode-region): Update mode info for major mode.
+
+	* mmm-sample.el: Created file, removing code from `mmm-mode.el'.
+
+	* mmm-auto.el: Created file, removing code from `mmm-mode.el'.
+
+	* mason.el: Created file, removing code from `mmm-mode.el'.
+
+	* mmm-insert.el: Created file, removing code from `mmm-mode.el'.
+
+2000-03-20  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+
+	* mmm-update.el: Created file, removing code from `mmm-mode.el'.
+
+	* mmm-inter.el: Created file, removing code from `mmm-mode.el'.
+
+	* mmm-class.el: Created file, removing code from `mmm-mode.el'.
+
+	* mmm-mode.el (mason): Removed highlight for %doc regions.
+
+	* mmm-region.el: Created file, removing code from `mmm-mode.el'.
+
+	* mmm-utils.el: Created file, removing code from `mmm-mode.el'.
+
+	* mmm-compat.el: Created file, removing code from `mmm-mode.el'.
+
+	* mmm-vars.el: Created file, removing code from `mmm-mode.el'.
+
+	* TODO: Created TODO file, removing comments from `mmm-mode.el'.
+
+	* ChangeLog: Created ChangeLog file and (more or less) ported
+	existing Change Log to official format.
+
+2000-03-19  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+	        
+	* mmm-mode.el (mmm-global-mode): usurps and extends the role of
+	`mmm-add-find-file-hook'. Other modes can piggyback on our hack by
+	using `mmm-major-mode-hook'.
+        
+	Added :insert class parameters. Classes can now define skeletons
+	to insert submode regions with delimiters based on a keypress.
+
+	Added `mmm-insert-modifiers' and `mmm-command-modifiers' to
+	configure which keys do what.
+
+2000-03-18  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+	
+	* mmm-mode.el: Did a bunch of reorganizing. MMM-ification methods
+	are now submode classes, and what used to be called submode
+	classes are now just a type called :group. User interface is
+	mostly unchanged however. Replaced some gratuitous keywords with
+	normal symbols.
+
+	Added bells and whistles to :regexp class type, allowing custom
+	"plugin" functions to verify matches and get the delimiter forms,
+	the latter of which aren't used yet, but will be soon. Mason
+	class(es) are now all regexps with a plugin or two. Function class
+	type is not (yet?) ported to the new interface, holding back
+	eval-elisp and htp.p with it.
+        
+	Changed a couple of `eval-and-compile's to `eval-when-compile'.
+        
+	Added special "non-submode" regions, where the major mode holds
+	sway, but no submodes allowed (until parents are implemented).
+	Added %doc in text-mode and %text as a non-submode to Mason, and
+	added %flags, %attr, %method, and %shared tags for Mason classes.
+	These will be new in Mason version 0.82.
+        
+2000-03-14  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+
+	* Version 0.3.7a released.
+
+	* mmm-mode.el: Put `turn-on-font-lock-if-enabled' back in for FSF
+	  Emacs. Don't know why I thought I could take it out.
+        
+2000------  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+
+	* Version 0.3.7 released.
+        
+	* mmm-mode.el: Set insertion types of markers added to history to
+	coincide with sticky ends of overlays. It's not perfect, but it's
+	better.
+
+	Renamed mode and submode hook variables to start with `mmm-'.
+
+	Added "class hooks" run whenever a class is first used in a
+	buffer.
+
+	Changes for XEmacs compatibility:
+          - Loaded XEmacs overlay emulation package.
+          - Renamed some overlay properties when in XEmacs
+          - Removed `global-font-lock-mode' dependencies.
+          - Added extra parameter to `regexp-opt' in Mason class.
+        
+	Removed "Disclaimers" comment section; I think we have enough
+	testing that it should work on most systems.
+        
+	Reversed order of Change Log so newer changes come first.
+        
+	Changed the default submode highlight to a more neutral gray.
+        
+	Renamed various "start" and "end" parameters to be more uniform.
+        
+	(mmm-ify-by-region): now checks if the region is in bounds.
+        
+1999------  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.3.6c released.
+        
+	* mmm-mode.el: Added comment about putting autohandlers and
+	dhandlers in html-mode.
+
+1999------  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.3.6b released.
+        
+	* mmm-mode.el: Added comment about `psgml-mode' thanks to Michael
+	Alan Dorman.
+
+1999------  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.3.6a released.
+
+	* mmm-mode.el: Loaded CL at compile-time to prevent execution of
+	macro arguments.
+
+1999------  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.3.6 released.
+        
+	* mmm-mode.el: Changes for Emacs 19 compatibility.
+	  - Set keyword variables to themselves.
+	  - Added hacks for absence of custom.el and regexp-opt.
+	  - Added user variable to control use of Perl mode vs CPerl mode.
+	Thanks to Eric A. Zarko for suggestions and testing.
+
+1999------  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.3.5a released.
+
+	* mmm-mode.el (mmm-ify-by-all): no longer re-fontifies buffers
+	with no submodes.
+
+1999------  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.3.5 released.
+
+	* mmm-mode.el (mmm-fontify-region): now locally binds
+	`font-lock-beginning-of-syntax-function' to
+	`mmm-beginning-of-syntax' since `font-lock-fontify-block' binds it
+	to nil for some reason.
+
+1999------  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.3.4 released.
+
+	* mmm-mode.el (mmm-ify-by-class): now fontifies the buffer
+	afterward, like the other interactive MMM-ification functions.
+	Updated a couple doc-strings and prompts.
+        
+1999------  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.3.3 released.
+
+	* mmm-mode.el (mmm-regexp-to-regions, mmm-mason-inline): Changed
+	recursion to iteration, since for long files the recursion runs
+	afoul of `max-lisp-eval-depth'.
+	(mason): Commented on workaround for Mason CPerl mess-ups.
+	Submode overlays now evaporate if they have zero width.
+	(mmm-parse-region): now has a key binding and doesn't refontify
+	the entire buffer.
+	
+1999------  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.3.2 released.
+        
+	* mmm-mode.el (mmm-mode-on, mmm-mode-off): are now interactive.
+	Fixed bug in Mason class: %def, %text, and %doc are now ignored as
+	they should be.
+
+1999-11-21  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.3.1 released.
+
+	* mmm-mode.el (mmm-ify-by-class) now adds to history rather than
+	`mmm-classes'.
+	Fixed :class keyword so it works correctly.
+	(mmm-add-mode-ext-class): Classes associated with major modes or
+	filenames now do The Right Thing when the major mode is changed.
+	However, `mmm-mode-ext-classes-alist' cannot be directly modified.
+	(mmm-mode): Updated documentation to cover 0.3.x changes.
+        
+1999-11-21  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.3.0 released.
+        
+	* mmm-mode.el (mmm-ify-by-class): Added interactive prompt.
+	(mmm-version): Function added to display version interactively.
+	Fixed and updated customization definitions.
+	(mmm-mode-ext-classes-alist): added, allowing the automatic
+	association of certain major-modes and/or file extensions with
+	submode classes.
+	Allowed submode lists to contain :class keyword, so one class can
+	invoke another one, if they share submode methods.
+
+1999-11-19  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+
+	* Version 0.2.2a released.
+        
+	* mmm-mode.el: Fixed bug.
+
+1999-11-18  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.2.2 released.
+
+	* mmm-mode.el (mmm-mason-inline): Replaces the regexps "<% " and
+	"%>" for HTML::Mason submode class. Inline perl regions don't have
+	to begin with a space, but the regexp "<%" matches "<%perl>" as
+	well, which it shouldn't.
+	Added `save-match-data' calls in all searching functions.
+	Removed unnecessary auxiliary functions.
+
+1999-11-16  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+        
+	* Version 0.2.1 released.
+        
+	* mmm-mode.el: Fixed font-lock absence, with-temp-message absence,
+	mmm-ifying temp buffer.
+
+1999-11-15  Michael Abraham Shulman  <viritrilbia@kurukshetra.cjb.net>
+	
+	* Version 0.2.0 released to HTML::Mason mailing list.
+
+	* Comment: Although nearly 100% of the code for mmm-mode was
+	written by me, the original inspiration came from mmm.el for
+	XEmacs by Gongquan Chen <chen@posc.org>, so I have continued his
+	version-numbering.
+        
+1999-01-12  Gongquan Chen <chen@posc.org>
+        
+	* Version 0.11 released.
+
+	* mmm.el: Fixed doc-strings and style. Thanks to comments from
+	Jari Aalto <jaalto@tre.tele.nokia.fi>
+
+1999-01-11  Gongquan Chen <chen@posc.org>
+	
+	* Version 0.10 released.
+
+	* mmm.el: Initial release of mmm.el on comp.emacs.xemacs
+-*-outline-*-
+              Frequently Asked Questions about MMM Mode
+              =========================================
+
+* How do I write/capitalize the name of this package/mode?
+
+However you want.  The author says `MMM Mode' (and occasionally `MMM')
+when discussing the entire package, and `mmm-mode' when discussing the
+emacs mode or function.  He does think, however, that `Mmm' looks
+rather ugly, although that is how SourceForge insists on capitalizing
+the name of the mailing list.
+
+* How do I get rid of that ugly gray background color?
+
+Put the following line in your Emacs initialization file:
+
+  (set-face-background 'mmm-default-submode-face nil)
+
+You may want to try using MMM Mode for a while with the background
+highlight, however, or merely changing it to different color.  There
+are two reasons it's there by default:
+
+1. MMM Mode isn't as smart as you might hope it would be about
+   recognizing new submode regions, so the presence or absence of the
+   highlight can let you know at a glance where it thinks they are.
+
+2. Just like the rest of font-lock, it helps you mentally organize the
+   code; you can see at a glance that THIS code is executed as Perl,
+   but THAT code is straight HTML (or whatever).
+
+* I typed `<%' (or other delimiter) but I'm still in the wrong mode.
+
+MMM Mode isn't that smart yet.  You have to tell it explicitly to
+reparse (`C-c % C-5' or `C-c % C-b') when you add new submode regions,
+and both delimiters have to be present.  Hopefully a future version
+will be able to automatically recognize new regions an you type them,
+but that version is not yet here.
+
+However, most submode classes provide insertion commands that remove
+the need to type the delimiters as well as the need to reparse the
+block: type `C-c % h' for a list of available insertion commands for
+current submode class(es).
+
+* Why won't MMM Mode work with `foo-mode'?
+
+Foo-mode probably has extra variables or states that need to be set
+up, that MMM Mode doesn't yet know about.  Often this sort of problem
+can be fixed by adding elements to `mmm-save-local-variables'.  If you
+know some Elisp, you may want to try and track down the problem
+yourself, or you can contact the mailing list and ask for help.
+Either way, please contact the maintainer or the mailing list when
+(if) you find something that works, so that in the future, folks can
+use MMM Mode and foo-mode together more easily.
+
+* I'm getting an emacs error, what did I do wrong?
+
+Most likely nothing.  MMM Mode is still more or less alpha software
+and is quite likely to contain bugs; probably something in your
+configuration has brought a new bug to light.  Please send the text of
+the error, along with a stack backtrace (1) and the relevant portions
+of your emacs initialization file, to either the maintainer or the
+mailing list, and hopefully a fix can be worked out.
+
+Of course, it's also possible that there is an error in your
+configuration.  Double-check the elisp syntax in your init file, or
+inspect the backtrace yourself.  If the error happens while loading
+your init code, try manually evaluating it line by line (`C-x C-e') to
+see where the error occurs.  Folks on the mailing list can also help
+point out errors, but only with your init code and a backtrace.
+
+(1) To get a stack backtrace of an error, set the emacs variable
+    `debug-on-error' to non-nil (type `M-x set-variable RET
+    debug-on-error RET t RET' or `M-: (setq debug-on-error t) RET'),
+    then repeat the actions which caused the error.  A stack backtrace
+    should pop up which you can select and copy.  If the error occurs
+    while loading emacs, invoke emacs with the `--debug-init' (Emacs)
+    or `-debug-init' (XEmacs) switch.
+
+* Will MMM Mode work with (Emacs 19 / XEmacs 20 / XEmacs 21 / etc...)?
+
+MMM Mode is designed for FSF Emacs 20 and works best there, but it can
+work in other emacsen, although problems may arise.  For instance, the
+font-lock support in XEmacs 20 is known to be broken and well-nigh
+unfixable; consider upgrading.  Even XEmacs 21 has more problems with
+font-lock: for example, often apostrophes in a different submode
+region can cause code to be incorrectly font-locked as a string.
+
+While not free of problems under Emacs 20, MMM Mode does tend to work
+best there, but don't let that stop you from trying it under other
+emacsen.  If you encounter problems, feel free to ask the mailing
+list, but success is not guaranteed.
+
+* XEmacs says `Symbol's function definition is void: make-indirect-buffer'.
+
+You probably used FSF Emacs to compile MMM as it is the one used by
+default if both are installed.  To explicitly set the emacs to use
+when byte compiling, do the following:
+
+$ cd mmm-mode-x.x.x
+$ make distclean
+$ EMACS=/usr/bin/xemacs ./configure
+$ make
+$ make install
+
+Running `make distclean' is only necessary if you have already
+compiled MMM Mode for the wrong emacs, but can never hurt.  The exact
+error message this problem produces may change with newer versions of
+MMM Mode; always be sure you have compiled for the correct emacsen.
+
+* You haven't answered my question; how can I get more help?
+
+At the MMM Mode web site, <http://mmm-mode.sourceforge.net>, there is
+a link to the sign-up page for the MMM Mode mailing list.  When asking
+a question on the list, be sure to give the versions of emacs and MMM
+Mode you are using, and any other relevant information.
+# Makefile for mmm-mode
+
+# This file is part of XEmacs.
+
+# XEmacs is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2, or (at your option) any
+# later version.
+
+# XEmacs is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+VERSION = 1.00
+AUTHOR_VERSION = 0.4.7
+MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
+PACKAGE = mmm-mode
+PKG_TYPE = regular
+REQUIRES = xemacs-base fsf-compat 
+CATEGORY = standard
+
+ELCS = mmm-auto.elc mmm-class.elc mmm-cmds.elc mmm-compat.elc mmm-mason.elc \
+	mmm-mode.elc mmm-region.elc mmm-rpm.elc mmm-sample.elc mmm-univ.elc \
+	mmm-utils.elc mmm-vars.elc
+
+EXTRA_SOURCES = AUTHORS FAQ README README.Mason TODO
+
+TEXI_FILES = mmm.texinfo texinfo.tex version.texi
+INFO_FILES = mmm.info*
+
+include ../../XEmacs.rules
+
+GENERATED += custom-load.elc
+
+all:: auto-autoloads.elc $(ELCS) custom-load.elc mmm.info
+
+srckit: srckit-std
+
+binkit: binkit-common
+MMM Mode NEWS -- history of user-visible changes.  -*-outline-*-
+Copyright (C) 2000 Michael Abraham Shulman
+See the file COPYING for copying conditions.
+
+Please send MMM Mode bug reports to viritrilbia@users.sourceforge.net
+
+* Changes in MMM Mode 0.4.7
+
+** Multiple Decoration Levels
+
+You now have finer control over how colorful your submode regions are,
+via `mmm-submode-decoration-level'.  Level 0 turns coloring off--no
+messing around with faces required.  Level 1 (default) is the same as
+in previous versions.  Level 2 colors regions according to function:
+initialization, cleanup, output, declaration, comment, etc.
+
+** Preferred Major Modes
+
+The variable `mmm-major-mode-preferences' lets you tell MMM what modes
+you prefer for different programming languages and they will be used
+by all submode classes.
+
+** New Submode Classes
+
+New submode classes for JSP and ePerl are included.  A major bug in
+the handling of embedded Java (and other C-type languages) was fixed,
+so the JSP class should work consistently.
+
+
+* MMM Mode 0.4.6 is a bug-fix release with one user-visible change:
+
+** New Submode Class for RPM Spec Files
+
+Contributed by Marcus Harnisch, the `rpm' submode class allows editing
+appropriate parts of RPM spec files in shell-script mode.
+
+
+* Changes in MMM Mode 0.4.5
+
+** Font-Lock works again in XEmacs
+
+The MMM code to handle font-locking broke in XEmacs several versions
+back due to differences in the font-lock implementation between Emacs
+and XEmacs.  It appears to be working once again.
+
+** Here-Document submode class improved
+
+Here-document names such as <<TEXT_EOF and <<END_PERL_CODE are now
+correctly recognized, and `mmm-here-doc-mode-alist' allows you to
+define your own mappings from here-document names to submodes.
+
+
+* Changes in MMM Mode 0.4.4
+
+** Tab Completion in `mmm-ify-by-class' (`C-c % C-c')
+
+When interactively specifying a submode class, completion on all
+defined public (not internal/private) submode classes is available.
+
+** Submode classes can now be autoloaded
+
+You don't need (require 'mmm-mason) or (require 'mmm-sample) in your
+.emacs file any more; all the supplied submode classes that are not
+automatically loaded are autoloaded from their files of definition.
+
+** Here-Document submode class can now recognize any submode
+
+As long as the name of the here-document is or begins with the name of
+the appropriate submode, suitably mangled, such as <<HTML or
+<<HTML_MODE or <<HTML_MODE_EOF, it should be correctly recognized.
+
+** New File Variables submode class
+
+Actually, this is an old submode class that now works (better than
+before) with the new post-0.3.8 syntax for class definition.  It is a
+good candidate for membership in `mmm-global-classes' if you use many
+file-local variables, but is not there by default.
+
+** New flags :include-{front,back}
+
+If the keywords INCLUDE-FRONT or INCLUDE-BACK are set to non-nil
+values in a submode class definition, the corresponding delimiter will
+be included inside the submode region.
+
+** New values for :{front,back}-offset
+
+The keywords FRONT-OFFSET and BACK-OFFSET can now be function to call,
+such as `beginning-of-line' or `end-of-line', or lists of values to
+apply in sequence, such as (end-of-line 1).
+
+** Search for next region now starts at end of previous one
+
+...rather than at the end of the previous region's ending delimiter.
+This allows matching regions ended only by the start of the next one.
+
+
+* Changes in MMM Mode 0.4.3
+
+** Syntax of Universal Class Changed
+
+Instead of %[MODE]% ... %[/MODE]%, the universal class now uses
+{%MODE%} ... {%/MODE%} which isn't quite as ugly and doesn't to my
+knowledge conflict with any other syntax.
+
+** Some Bugs under Emacs 19 and XEmacs Fixed
+
+
+* Changes in MMM Mode 0.4.2
+
+** Global Classes and `Universal' Class
+
+The new variable `mmm-global-classes' is the inverse of `mmm-classes'
+in that it contains submode classes which apply to all MMM Mode
+buffers unless turned off manually with file-local variables.  By
+default, it contains the class `universal', which defines the syntax
+%[MODE]% ... %[/MODE]% to specify regions of any mode.  This allows,
+for instance, example code embedded in an email to be both edited by
+the sender and viewed by the receiver in an appropriate mode.
+
+** New Embperl Submode Class
+
+The new supplied submode class `embperl', which can be loaded with
+(require 'mmm-sample), detects the Embperl syntax [+...+] (and so on)
+for embedded Perl code.
+
+
+* Changes in MMM Mode 0.4.1
+
+** Font Lock Parsing Speed Improved
+
+Extra regions were being parsed due to an error in finding the right
+regions, slowing down the parsing considerably.  This has been fixed.
+
+
+* Changes in MMM Mode 0.4.0
+
+** Improved Local Variable Saving
+
+Local variables can now be saved for only some major modes, as well as
+both globally, per-buffer, or per-submode region.  This facility is
+now used to save the font-lock cache state, possible improving the
+font-lock support.  See the docs for `mmm-save-local-variables'.
+
+** Get and Set Class Parameters
+
+The functions `mmm-[get,set]-class-parameters' do just that.  The
+latter modifies the definition of a submode class, affecting all
+subsequent applications of that class.
+
+** New Implementation for MMM Global Mode
+
+The implementation of MMM Global Mode has been changed from the
+"stack-walk" method to the "post-command-hook" method used by
+global-font-lock-mode.  This is arguably cleaner, but more
+importantly, waits until after all local variables and text are loaded
+before trying to enabling MMM Mode.
+
+
+* MMM Mode 0.3.10 is a bug-fix release with no user-visible changes
+
+
+* MMM Mode 0.3.9 is a bug-fix release with no user-visible changes
+
+
+* Changes in MMM Mode 0.3.8
+
+** IMPORTANT: Default key bindings have changed.
+
+The MMM Mode commands, including interactive MMM-ification and
+re-parsing buffer regions, are now bound by default to key sequences
+of the form `C-c % C-<letter>', rather than `C-c % <letter>' as
+in previous versions.  Key sequences of the form `C-c % <letter>' are
+now reserved for submode region insertion.  The old behavior can be
+restored by setting the variable `mmm-use-old-command-keys' to a
+non-nil value before MMM Mode is loaded--then insertion commands are
+bound to `C-c % C-<letter>' sequences.
+
+** New Global Mode added
+
+MMM Global Mode can now turn MMM Mode on automatically in all buffers,
+or only in buffers that have associated submode classes.  It replaces
+the previous function `mmm-add-find-file-hook', which still works for
+now.  A side effect of this change is that it is no longer necessary
+to use `mmm-add-mode-ext-class': `mmm-mode-ext-classes-alist' can be
+modified directly.
+
+The hack used by MMM Global Mode to insinuate itself into all buffers
+is different from, but vaguely similar to, the one used by FSF Emacs'
+Global Font Lock Mode.  In order that future writers of global modes
+don't have to reinvent the wheel, MMM Global Mode provides the hook
+`mmm-major-mode-hook' which is run (in theory) whenever a major mode
+starts up.  Perhaps in future this will be provided in a separate
+package.
+
+** Automatic submode region insertion commands
+
+Submode classes can now define skeletons for automatic insertion of
+submode regions with delimiters.  For example, when using the Mason
+class, the key sequence `C-c % %' will (by default) insert the text
+`<% -!- %>' with point where indicated and submode region already
+present.  These commands also wrap around words as described in the
+documentation of `skeleton-insert'.
+
+** Info Documentation File
+
+MMM Mode now has an (admittedly incomplete) manual in Texinfo format.
+It can be found in the files `mmm.info' or `mmm.texinfo' in the
+distribution.
+
+** Automatic Installation
+
+MMM Mode now uses GNU automake/autoconf for ease of installation.  See
+the files README and INSTALL for more information.
+
+** Changed submode class specification format
+
+This change affects only people who define their own submode classes.
+The format for defining submode classes has changed; it now uses
+keyword arguments for clarity and has a few more possible arguments,
+including skeletons for submode region insertion.
+
+                          MMM Mode for Emacs
+                          ==================
+
+OVERVIEW
+
+  MMM Mode is a minor mode for Emacs that allows Multiple Major Modes
+  (hence the name) to coexist in one buffer.  It is particularly
+  well-suited to editing embedded code, such as Mason server-side
+  Perl, or HTML output in CGI scripts.
+
+INSTALLATION
+
+  MMM Mode has a standard GNU configure-driven installation.  (See the
+  file INSTALL for generic instructions.)  To install mmm-mode in the
+  standard locations, unpack the archive, `cd' to the mmm-mode-X.X.X
+  directory created, and run these commands:
+
+    ./configure
+    make
+    make install
+
+  Alternately, since currently MMM Mode is written in pure Emacs Lisp,
+  you could just copy all the *.el files in the distribution to a
+  directory in your `load-path', and optionally byte-compile them
+  manually (see the Emacs Manual).  The configure installation also
+  installs the MMM Mode info manual in your site info directory, so if
+  you're installing manually, you might want to do that too.
+
+  If you have more than one version of emacs installed and want to
+  use MMM in a version other than /usr/bin/emacs, you must set the
+  environment variable EMACS before running `configure', e.g.
+
+    EMACS=/usr/bin/xemacs ./configure
+    make
+    make install
+
+  If you want to use MMM in more than one version of emacs, you must
+  either have separate site-lisp directories (such as Debian does), or
+  load it from source every time; byte-compiled files are not portable
+  between emacsen.
+
+CONFIGURATION
+
+  Once MMM Mode is installed, it has to be configured correctly.  This
+  can be done in a site-start file or in user's initialization files;
+  probably the latter is preferable, except possibly for autoloads.
+
+  See the info file for full documentation on the available
+  configuration options.  To get started, however, MMM Mode needs to
+  be loaded, either completely, with
+
+    (require 'mmm-mode)
+
+  or conditionally, as necessary, with
+
+    (require 'mmm-auto)
+
+  The second installs only the major-mode hooks and sets up MMM Mode
+  to load itself automatically when necessary.
+
+DOCUMENTATION
+
+  For further information, see (in order) the accompanying info file
+  (as yet incomplete), the documentation strings of functions and
+  variables, the comments in the source code, and the source code
+  itself.
+
+UPDATES
+
+  The latest version of MMM Mode should always be available from
+  http://mmm-mode.sourceforge.net/.
+
+BUG REPORTS
+
+  Bug reports and suggestions can be submitted at
+  <http://sourceforge.net/bugs/?group_id=8658> or through email to
+  viritrilbia@users.sourceforge.net.
+
+CONTACT INFO
+
+  MMM Mode is written and maintained by Michael Abraham Shulman
+  <viritrilbia@users.sourceforge.net>.
+
+MAILING LIST
+
+  To subscribe to the MMM Mode mailing list, visit
+  <http://lists.sourceforge.net/mailman/listinfo/mmm-mode-discuss>.
+  The mailing list receives announcements of new releases and provides
+  a forum for discussion of bugs and features.
+
+  Thanks for using MMM Mode!
+-*-text-*-
+                Using MMM Mode for Mason: An Overview
+                =====================================
+
+  Since many users of MMM Mode use it for Mason <www.masonhq.com>, and
+  since the Mason submode class is the most complex one supplied, a
+  few comments regarding its usage are in order.  Even if you don't
+  use Mason, this file may be of interest to you as an example of MMM
+  usage and possible problems.
+
+INSTALLATION AND LOADING
+
+  For general installation and information, see the README file and
+  the texinfo documentation.  The submode class for Mason components
+  is called `mason' and is automatically loaded from `mmm-mason.el'
+  the first time it is used.
+
+MODES AND EXTENSIONS
+
+  If you want to have mason submodes automatically in all Mason files,
+  you can use `mmm-mode-ext-classes-alist'; the details depend on what
+  you call your Mason components and what major mode you use.  Some
+  example elements of `mmm-mode-ext-classes-alist' follow, with
+  comments on the corresponding naming scheme.
+
+  (html-mode "\\.html\\'" mason)         ;; Any .html file in html-mode
+  (hm--html-mode nil mason)              ;; Any buffer in hm--html-mode
+  (sgml-mode nil mason)                  ;; Any buffer in sgml-mode
+  (nil "\\.\\(mason\\|html\\)\\'" mason) ;; All .mason and .html files
+  (nil "\\.m[dc]\\'" mason)              ;; All .md and .mc files
+  (nil "\\`/var/www/mason/" mason)       ;; Any file in the directory
+  (nil nil mason)                        ;; All buffers.
+
+  In order for any of these to work, you must set `mmm-global-mode' to
+  a non-nil value, such as `t' or `maybe' (the two of which mean
+  different things; see the documentation).  This can be done with a
+  line in .emacs such as the following:
+
+  (setq mmm-global-mode 'maybe)
+
+  If you use an extension for your Mason files that emacs does not
+  automatically place in your preferred HTML Mode (be it html-mode,
+  sgml-html-mode, hm--html-mode, or whatever), you will probably want
+  to associate that extension with your HTML Mode (this is a feature
+  of emacs, not MMM Mode).  An example is shown below.
+
+  (add-to-list 'auto-mode-alist '("\\.mason\\'" . html-mode))
+
+  This also goes for "special" Mason files such as autohandlers and
+  dhandlers.  The code below tells emacs to use html-mode for files
+  named `autohandler' and `dhandler'.
+
+  (add-to-list 'auto-mode-alist '("\\(auto\\|d\\)handler\\'" . html-mode))
+
+  An alternate solution is to change the names of your autohandlers
+  and dhandlers so that emacs recognizes them as HTML automatically.
+  Similar code can be used to recognize all files in a given directory
+  as HTML and/or Mason.
+
+CPERL PROBLEMS
+
+  There are certain problems with CPerl mode in submode regions.  (Not
+  to say that the original perl-mode would do any better--it hasn't
+  been much tried.)  First of all, the first line of a Perl section
+  is usually indented as if it were a continuation line.  A fix for
+  this is to start with a semicolon on the first line.  The insertion
+  key commands do this whenever the Mason syntax allows it.
+
+  <%perl>;
+  print $var;
+  </%perl>
+
+  In addition, some users have reported that the CPerl indentation
+  sometimes does not work.  This problem has not yet been tracked
+  down, however, and more data about when it happens would be helpful.
+
+PSGML PROBLEMS
+
+  Michael Alan Dorman has reported problems using PSGML with Mason. He
+  suggests adding these lines to .emacs to turn it off.
+
+  (delete '("\\.html$" . sgml-html-mode) auto-mode-alist)
+  (delete '("\\.shtml$" . sgml-html-mode) auto-mode-alist)
+
+  Other users report using PSGML with Mason and MMM Mode without
+  difficulty.  If you don't have problems and want to use PSGML,
+  simply replace `html-mode' everywhere in the suggested code with
+  `sgml-html-mode' or `sgml-mode'.  Similarly, if you are using XEmacs
+  and want to use the alternate HTML mode `hm--html-mode', replace
+  `html-mode' with that symbol.
+
+  One problem that crops up when using PSGML with Mason is that even
+  ignoring the special tags and Perl code (which, as I've said,
+  haven't caused me any problems), Mason components often are not a
+  complete SGML document.  For instance, my autohandlers often say
+
+  <body>
+    <% $m->call_next %>
+  </body>
+
+  in which case the actual components contain no doctype declaration,
+  <html>, <head>, or <body>, confusing PSGML.  One solution I've found
+  is to use the variable `sgml-parent-document' in such incomplete
+  components; try, for example, these lines at the end of a component.
+
+  %# Local Variables:
+  %# sgml-parent-document: ("autohandler" nil ("body"))
+  %# End:
+
+  This tells PSGML that the current file is a sub-document of the file
+  `autohandler' and is included inside a <body> tag, thus alleviating
+  its confusion.
+Hey Emacs, this is a -*-text-*- file!
+
+                       To Do List for MMM Mode
+                       =======================
+
+Custom mode functions like `mason-mode'.
+
+Make Mason work a little better with PSGML.  The fix I've found works,
+but it would be nifty if MMM could do it automatically.  Maybe the
+custom-mode thing could set the variables, or a hook somewhere.
+
+Apostrophes mess up Perl parsing in XEmacs but not Emacs.  I thought
+it was because XEmacs sets `font-lock-beginning-of-syntax-function'
+after MMM does, but changing that that didn't fix it.
+
+Improve re-parsing current region to use inclusion/offsets/etc.
+
+Support for: ASP, PHP
+
+DEB and/or RPM packages would be nice.
+
+The local-variables improvements can probably be used to set minor
+modes locally to submode regions.  This could replace tmmofl,
+especially if we search for regions other than by regexps, say by
+syntax properties.
+
+Trap paragraph motion commands to stop at submode boundaries?
+
+On text insertion (in `after-change-functions'), do two things.
+First, if inside in a region, or after a hanging one, scan for its
+back and adjust if necessary.  Second, scan both for complete regions
+and for hanging fronts.  In the latter case, we may insert the back or
+start a hanging region; user option.  Don't just scan the inserted
+text, but backwards, using `mmm-looking-back-at'.  Remember to handle
+delimiter inclusion and offsets as best possible.
+
+It would be nice if C-j ended a Mason one-liner and began a new one on
+the next line.  This is a rather Mason-specific thing, but other
+classes might have similar single-line regions.  Add a new submode
+class argument, such as KEYMAP, or even ONE-LINE?
+
+Allow a submode class to specify its allowable "parent" submode
+classes.  This could also be used to implement htp.p, by first
+scanning for the function calls as a major-mode submode region, then
+requiring that parent type for the HTML mode class.  Nested submodes
+alternate highlight colors, say with `mmm-secondary-submode-face'.
+
+Ought %text in Mason to be a non-submode, since any Mason tags inside
+it will probably be /edited/ as Perl (being, say, code examples)?
+Only problem is it might confuse the programmer into thinking that
+code will get executed. Maybe use a different face.  Could do that
+with another grouping class, say uneval-mason, that overrides the
+faces of mason and has :parent mason-text, and allow a mode to specify
+what about it changes depending on its parent, or a parent to specify
+changes to its children, or a group to specify changes to its members.
+
+If font-locking needs more help, try narrowing the region before
+fontifying, or even advising `parse-partial-sexp' and friends.  At
+present, it seems good enough, though.
+
+It'd be nice if submode regions could preserve the indentation of the
+dominant major mode code around them. For example, Perl code embedded
+in HTML where the HTML is indented such as for a table.
+;;; mmm-auto.el --- loading and enabling MMM Mode automatically
+
+;; Copyright (C) 2000 by Michael Abraham Shulman
+
+;; Author: Michael Abraham Shulman <mas@kurukshetra.cjb.net>
+;; Version: $Id$
+
+;;{{{ GPL
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;}}}
+
+;;; Commentary:
+
+;; This file contains functions and hooks to load and enable MMM Mode
+;; automatically. It sets up autoloads for the main MMM Mode functions
+;; and interactive commands, and also sets up MMM Global Mode.
+
+;;{{{ Comments on MMM Global Mode
+
+;; This is a kludge borrowed from `global-font-lock-mode'.  The idea
+;; is the same: we have a function (here `mmm-mode-on-maybe') that we
+;; want to be run whenever a major mode starts.  Unfortunately, there
+;; is no hook (like, say `major-mode-hook') that all major modes run
+;; when they are finished.  `post-command-hook', however, is run after
+;; *every* command, so we do our work in there.  (Actually, using
+;; `post-command-hook' is even better than being run by major mode
+;; functions, since it is run after all local variables and text are
+;; loaded, which may not be true in certain cases for the other.)
+
+;; In order to do this magic, we rely on the fact that there *is* a
+;; hook that all major modes run when *beginning* their work. They
+;; call `kill-all-local-variables' (unless they are broken), which in
+;; turn runs `change-major-mode-hook'.  So we add a function to *that*
+;; hook which saves the current buffer and temporarily adds a function
+;; to `post-command-hook' which processes that buffer.
+
+;; Actually, in the interests of generality, what that function does
+;; is run the hook `mmm-major-mode-hook'. Our desired function
+;; `mmm-mode-on-maybe' is then added to that hook. This way, if the
+;; user wants to run something else on every major mode, they can just
+;; add it to `mmm-major-mode-hook' and take advantage of this hack.
+
+;;}}}
+
+;;; Code:
+
+(require 'cl)
+(require 'mmm-vars)
+
+;;{{{ Autoload Submode Classes
+
+(defvar mmm-autoloaded-classes
+  '((mason "mmm-mason" nil)
+    (embedded-css "mmm-sample" nil)
+    (html-js "mmm-sample" nil)
+    (here-doc "mmm-sample" nil)
+    (embperl "mmm-sample" nil)
+    (eperl "mmm-sample" nil)
+    (jsp "mmm-sample" nil)
+    (file-variables "mmm-sample" nil)
+    (rpm-sh "mmm-rpm" t)
+    (rpm "mmm-rpm" nil)
+    )
+  "Alist of submode classes autoloaded from files.
+Elements look like \(CLASS FILE PRIVATE) where CLASS is a submode
+class symbol, FILE is a string suitable for passing to `load', and
+PRIVATE is non-nil if the class is invisible to the user.  Classes can
+be added to this list with `mmm-autoload-class'.")
+
+(defun mmm-autoload-class (class file &optional private)
+  "Autoload submode class CLASS from file FILE.
+PRIVATE, if non-nil, means the class is user-invisible.  In general,
+private classes need not be autoloaded, since they will usually be
+invoked by a public class in the same file."
+  ;; Don't autoload already defined classes
+  (unless (assq class mmm-classes-alist)
+    (add-to-list 'mmm-autoloaded-classes
+                 (list class file private))))
+
+;;}}}
+;;{{{ Autoload Functions
+
+;; To shut up the byte compiler.
+(eval-and-compile
+  (autoload 'mmm-mode-on "mmm-mode" "Turn on MMM Mode. See `mmm-mode'.")
+  (autoload 'mmm-mode-off "mmm-mode" "Turn off MMM Mode. See `mmm-mode'.")
+  (autoload 'mmm-update-font-lock-buffer "mmm-region")
+  (autoload 'mmm-ensure-fboundp "mmm-utils")
+  (autoload 'mmm-mode "mmm-mode"
+    "Minor mode to allow multiple major modes in one buffer.
+Without ARG, toggle MMM Mode. With ARG, turn MMM Mode on iff ARG is
+positive and off otherwise." t))
+
+;; These may actually be used.
+(autoload 'mmm-ify-by-class "mmm-cmds" "" t)
+(autoload 'mmm-ify-by-regexp "mmm-cmds" "" t)
+(autoload 'mmm-ify-region "mmm-cmds" "" t)
+(autoload 'mmm-parse-buffer "mmm-cmds" "" t)
+(autoload 'mmm-parse-region "mmm-cmds" "" t)
+(autoload 'mmm-parse-block "mmm-cmds" "" t)
+(autoload 'mmm-clear-current-region "mmm-cmds" "" t)
+(autoload 'mmm-reparse-current-region "mmm-cmds" "" t)
+(autoload 'mmm-end-current-region "mmm-cmds" "" t)
+(autoload 'mmm-insertion-help "mmm-cmds" "" t)
+(autoload 'mmm-insert-region "mmm-cmds" "" t)
+
+;;}}}
+;;{{{ MMM Global Mode
+
+(defvar mmm-changed-buffers-list ()
+  "Buffers that need to be checked for running the major mode hook.")
+
+(defun mmm-major-mode-change ()
+  "Add this buffer to `mmm-changed-buffers-list' for checking.
+When the current command is over, MMM Mode will be turned on in this
+buffer depending on the value of `mmm-global-mode'.  Actually,
+everything in `mmm-major-mode-hook' will be run."
+  (and (boundp 'mmm-mode)
+       mmm-mode
+       (mmm-mode-off))
+  (add-to-list 'mmm-changed-buffers-list (current-buffer))
+  (add-hook 'post-command-hook 'mmm-check-changed-buffers))
+
+(add-hook 'change-major-mode-hook 'mmm-major-mode-change)
+
+(defun mmm-check-changed-buffers ()
+  "Run major mode hook for the buffers in `mmm-changed-buffers-list'."
+  (remove-hook 'post-command-hook 'mmm-check-changed-buffers)
+  (dolist (buffer mmm-changed-buffers-list)
+    (when (buffer-live-p buffer)
+      (save-excursion
+        (set-buffer buffer)
+        (mmm-run-major-mode-hook))))
+  (setq mmm-changed-buffers-list '()))
+
+(defun mmm-mode-on-maybe ()
+  "Conditionally turn on MMM Mode.
+Turn on MMM Mode if `global-mmm-mode' is non-nil and there are classes
+to apply, or always if `global-mmm-mode' is t."
+  (cond ((eq mmm-global-mode t) (mmm-mode-on))
+        ((not mmm-global-mode))
+        ((mmm-get-all-classes nil) (mmm-mode-on)))
+  (when mmm-mode
+    (mmm-update-font-lock-buffer)))
+
+(add-hook 'mmm-major-mode-hook 'mmm-mode-on-maybe)
+
+(defalias 'mmm-add-find-file-hooks 'mmm-add-find-file-hook)
+(defun mmm-add-find-file-hook ()
+  "Equivalent to \(setq mmm-global-mode 'maybe).
+This function is deprecated and may be removed in future."
+  (message "Warning: `mmm-add-find-file-hook' is deprecated.")
+  (setq mmm-global-mode 'maybe))
+
+;;}}}
+
+(provide 'mmm-auto)
+
+;;; mmm-auto.el ends here
+;;; mmm-class.el --- MMM submode class variables and functions
+
+;; Copyright (C) 2000 by Michael Abraham Shulman
+
+;; Author: Michael Abraham Shulman <mas@kurukshetra.cjb.net>
+;; Version: $Id$
+
+;;{{{ GPL
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;}}}
+
+;;; Commentary:
+
+;; This file contains variable and function definitions for
+;; manipulating and applying MMM submode classes. See `mmm-vars.el'
+;; for variables that list classes.
+
+;;; Code:
+
+(require 'cl)
+(require 'mmm-vars)
+(require 'mmm-region)
+
+;;{{{ Get Class Specifications
+
+(defun mmm-get-class-spec (class)
+  "Get the class specification for CLASS.
+CLASS can be either a symbol to look up in `mmm-classes-alist' or a
+class specifier itself."
+  (cond ((symbolp class)        ; A symbol must be looked up
+         (or (cdr (assq class mmm-classes-alist))
+             (and (cadr (assq class mmm-autoloaded-classes))
+                  (load (cadr (assq class mmm-autoloaded-classes)))
+                  (cdr (assq class mmm-classes-alist)))
+             (signal 'mmm-invalid-submode-class (list class))))
+        ((listp class)          ; A list must be a class spec
+         class)
+        (t (signal 'mmm-invalid-submode-class (list class)))))
+
+;;}}}
+;;{{{ Get and Set Class Parameters
+
+(defun mmm-get-class-parameter (class param)
+  "Get the value of the parameter PARAM for CLASS, or nil if none."
+  (cadr (member param (mmm-get-class-spec class))))
+
+(defun mmm-set-class-parameter (class param value)
+  "Set the value of the parameter PARAM for CLASS to VALUE.
+Creates a new parameter if one is not present."
+  (let* ((spec (mmm-get-class-spec class))
+         (current (member param spec)))
+    (if current
+        (setcar (cdr current) value)
+      (nconc spec (list param value)))))
+
+;;}}}
+;;{{{ Apply Classes
+
+(defun* mmm-apply-class
+    (class &optional (start (point-min)) (stop (point-max)) face)
+  "Apply the submode class CLASS from START to STOP in FACE.
+If FACE is nil, the face for CLASS is used, or the default face if
+none is specified by CLASS."
+  ;; The "special" class t means do nothing. It is used to turn on
+  ;; MMM Mode without applying any classes.
+  (unless (eq class t)
+    (apply #'mmm-ify :start start :stop stop
+           (append (mmm-get-class-spec class)
+                  (list :face face)))))
+
+(defun* mmm-apply-classes
+    (classes &key (start (point-min)) (stop (point-max)) face)
+  "Apply all submode classes in CLASSES, in order.
+All classes are applied regardless of any errors that may occur in
+other classes. If any errors occur, `mmm-apply-classes' exits with an
+error once all classes have been applied."
+  (let (invalid-classes)
+    (dolist (class classes)
+      (condition-case err
+          (mmm-apply-class class start stop face)
+        (mmm-invalid-submode-class
+         ;; Save the name of the invalid class, so we can report them
+         ;; all together at the end.
+         (add-to-list 'invalid-classes (second err)))))
+    (when invalid-classes
+      (signal 'mmm-invalid-submode-class invalid-classes))))
+
+;;}}}
+;;{{{ Apply All Classes
+
+(defun* mmm-apply-all (&key (start (point-min)) (stop (point-max)))
+  "MMM-ify from START to STOP by all submode classes.
+The classes come from mode/ext, `mmm-classes', `mmm-global-classes',
+and interactive history."
+  (mmm-clear-overlays start stop 'strict)
+  (mmm-apply-classes (mmm-get-all-classes t) :start start :stop stop)
+  (mmm-update-current-submode)
+  (mmm-refontify-maybe start stop))
+
+;;}}}
+;;{{{ Scan for Regions
+
+(defun* mmm-ify
+    (&rest all &key classes handler submode face
+           (start (point-min)) (stop (point-max))
+           front back save-matches (case-fold-search t)
+           (beg-sticky (not (number-or-marker-p front)))
+           (end-sticky (not (number-or-marker-p back)))
+           include-front include-back
+           (front-offset 0) (back-offset 0)
+           front-verify back-verify
+           front-form back-form creation-hook
+           match-submode match-face
+	   (front-match 0)
+	   (back-match 0)
+	   end-not-begin
+           ;insert
+           &allow-other-keys
+           )
+  "Create submode regions from START to STOP according to arguments.
+If CLASSES is supplied, it must be a list of valid CLASSes. Otherwise,
+the rest of the arguments are for an actual class being applied. See
+`mmm-classes-alist' for information on what they all mean."
+  ;; Make sure we get the default values in the `all' list.
+  (setq all (append
+             all
+             (list :start start :stop stop :beg-sticky beg-sticky
+                   :end-sticky end-sticky :front-offset front-offset
+                   :back-offset back-offset
+		   :front-match 0
+		   :back-match 0)))
+  (cond
+   ;; If we have a class list, apply them all.
+   (classes
+    (mmm-apply-classes classes :start start :stop stop :face face))
+   ;; Otherwise, apply this class.
+   ;; If we have a handler, call it.
+   (handler
+    (apply handler all))
+   ;; Otherwise, we search from START to STOP for submode regions,
+   ;; continuining over errors, until we don't find any more. If FRONT
+   ;; and BACK are number-or-markers, this should only execute once.
+   (t
+    (mmm-save-all
+     (goto-char start)
+     (loop for (beg end matched-front matched-back
+                    matched-submode matched-face back-to resume-at) =
+                    (apply #'mmm-match-region :start (point) all)
+           while beg
+           while (or (not end) (/= beg end)) ; Sanity check
+           if end do            ; match-submode, if present, succeeded.
+           (condition-case nil
+               (progn
+                 (apply #'mmm-make-region (or matched-submode submode)
+                        beg end :front matched-front :back matched-back
+                        :face (or matched-face face) all)
+		 (goto-char resume-at))
+             ;; If our region is invalid, go back to the end of the
+             ;; front match and continue on.
+             (mmm-invalid-parent (goto-char back-to)))
+           ;; If match-submode was unable to find a match, go back to
+           ;; the end of the front match and continue on.
+           else do (goto-char back-to)
+           )))))
+
+;;}}}
+;;{{{ Match Regions
+
+(defun* mmm-match-region
+    (&key start stop front back front-verify back-verify
+          include-front include-back front-offset back-offset
+          front-form back-form save-matches match-submode match-face
+	  front-match back-match end-not-begin
+          &allow-other-keys)
+  "Find the first valid region between point and STOP.
+Return \(BEG END FRONT-FORM BACK-FORM SUBMODE FACE BACK-TO) specifying
+the region.  See `mmm-match-and-verify' for the valid values of FRONT
+and BACK \(markers, regexps, or functions).  A nil value for END means
+that MATCH-SUBMODE failed to find a valid submode.  BACK-TO is the
+point at which the search should continue if the region is invalid."
+  (when (mmm-match-and-verify front start stop front-verify)
+    (let ((beg (mmm-match->point include-front front-offset 
+				 front-match back-match))
+          (back-to (match-end front-match))
+          (front-form (mmm-get-form front-form)))
+      (let ((submode (if match-submode
+                         (condition-case nil
+                             (mmm-save-all
+                              (funcall match-submode front-form))
+                           (mmm-no-matching-submode
+                            (return-from
+                                mmm-match-region
+                              (values nil nil nil nil nil back-to))))
+                       nil))
+            (face (cond ((functionp match-face)
+                         (mmm-save-all
+                          (funcall match-face front-form)))
+                        (match-face
+                         (cdr (assoc front-form match-face))))))
+        (when (mmm-match-and-verify
+               (if save-matches
+                   (mmm-format-matches back)
+                 back)
+               beg stop back-verify)
+          (let* ((end (mmm-match->point (not include-back) back-offset 
+					front-match back-match))
+		 (back-form (mmm-get-form back-form))
+		 (resume-at (if end-not-begin 
+				(match-end back-match)
+			      end)))
+            (values beg end front-form back-form submode face back-to resume-at)))))))
+
+(defun mmm-match->point (beginp offset front-match back-match)
+  "Find a point of starting or stopping from the match data.  If
+BEGINP, start at \(match-beginning FRONT-MATCH), else \(match-end
+BACK-MATCH), and move OFFSET.  Handles all values for OFFSET--see
+`mmm-classes-alist'."
+  (save-excursion
+    (goto-char (if beginp (match-beginning front-match) (match-end back-match)))
+    (dolist (spec (if (listp offset) offset (list offset)))
+      (if (numberp spec)
+          (forward-char (or spec 0))
+        (funcall spec)))
+    (point)))
+
+(defun mmm-match-and-verify (pos start stop &optional verify)
+  "Find first match for POS between point and STOP satisfying VERIFY.
+Return non-nil if a match was found, and set match data. POS can be a
+number-or-marker, a regexp, or a function.
+
+If POS is a number-or-marker, it is used as-is. If it is a string, it
+is searched for as a regexp until VERIFY returns non-nil. If it is a
+function, it is called with argument STOP and must return non-nil iff
+a match is found, and set the match data. Note that VERIFY is ignored
+unless POS is a regexp."
+  (cond
+   ;; A marker can be used as-is, but only if it's in bounds.
+   ((and (number-or-marker-p pos) (>= pos start) (<= pos stop))
+    (goto-char pos)
+    (looking-at ""))            ; Set the match data
+   ;; Strings are searched for as regexps.
+   ((stringp pos)
+    (loop always (re-search-forward pos stop 'limit)
+          until (or (not verify) (mmm-save-all (funcall verify)))))
+   ;; Otherwise it must be a function.
+   ((functionp pos)
+    (funcall pos stop))))
+
+;;}}}
+;;{{{ Get Delimiter Forms
+
+(defun mmm-get-form (form)
+  "Return the delimiter form specified by FORM.
+If FORM is nil, call `mmm-default-get-form'. If FORM is a string,
+return it. If FORM is a function, call it. If FORM is a list, return
+its `car' \(usually in this case, FORM is a one-element list
+containing a function to be used as the delimiter form."
+  (cond ((stringp form) form)
+        ((not form) (mmm-default-get-form))
+        ((functionp form) (mmm-save-all (funcall form)))
+        ((listp form) (car form))))
+
+(defun mmm-default-get-form ()
+  (regexp-quote (match-string 0)))
+
+;;}}}
+
+(provide 'mmm-class)
+
+;;; mmm-class.el ends here
+;;; mmm-cmds.el --- MMM Mode interactive commands and keymap
+
+;; Copyright (C) 2000 by Michael Abraham Shulman
+
+;; Author: Michael Abraham Shulman <mas@kurukshetra.cjb.net>
+;; Version: $Id$
+
+;;{{{ GPL
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;}}}
+
+;;; Commentary:
+
+;; This file contains the interactive commands for MMM Mode.
+
+;;; Code:
+
+(require 'font-lock)
+(require 'mmm-compat)
+(require 'mmm-vars)
+(require 'mmm-class)
+
+;;{{{ Applying Predefined Classes
+
+(defun mmm-ify-by-class (class)
+  "Add submode regions according to an existing submode class."
+  (interactive
+   (list (intern
+          (completing-read
+           "Submode Class: "
+           (remove-duplicates
+            (remove nil
+                    (nconc
+                     (mapcar #'(lambda (spec)
+                                 (if (plist-get (cdr spec) :private)
+                                     nil
+                                   (list (symbol-name (car spec)))))
+                             mmm-classes-alist)
+                     (mapcar #'(lambda (spec)
+                                 (if (caddr spec)
+                                     nil
+                                   (list (symbol-name (car spec)))))
+                             mmm-autoloaded-classes))))
+           nil t))))
+  (unless (eq class (intern ""))
+    (mmm-apply-class class)
+    (mmm-add-to-history class)
+    (mmm-update-font-lock-buffer)))
+
+;;}}}
+;;{{{ Applying by the Region
+
+(defun mmm-ify-region (submode front back)
+  "Add a submode region for SUBMODE coinciding with current region."
+  (interactive "aSubmode: \nr")
+  (mmm-ify :submode submode :front front :back back)
+  (setq front (mmm-make-marker front t nil)
+        back (mmm-make-marker back nil nil))
+  (mmm-add-to-history `(:submode ,submode :front ,front :back ,back))
+  (mmm-enable-font-lock submode))
+
+;;}}}
+;;{{{ Applying Simple Regexps
+
+(defun mmm-ify-by-regexp
+  (submode front front-offset back back-offset save-matches)
+  "Add SUBMODE regions to the buffer delimited by FRONT and BACK.
+With prefix argument, prompts for all additional keywords arguments.
+See `mmm-classes-alist'."
+  (interactive "aSubmode: 
+sFront Regexp: 
+nOffset from Front Regexp: 
+sBack Regexp: 
+nOffset from Back Regexp: 
+nNumber of matched substrings to save: ")
+  (let ((args (mmm-save-keywords submode front back front-offset
+                                 back-offset save-matches)))
+    (apply #'mmm-ify args)
+    (mmm-add-to-history args))
+  (mmm-enable-font-lock submode))
+
+;;}}}
+;;{{{ Re-parsing Areas
+
+(defun mmm-parse-buffer ()
+  "Re-apply all applicable submode classes to current buffer.
+Clears all current submode regions, reapplies all past interactive
+mmm-ification, and applies `mmm-classes' and mode-extension classes."
+  (interactive)
+  (message "MMM-ifying buffer...")
+  (mmm-apply-all)
+  (message "MMM-ifying buffer...done"))
+
+(defun mmm-parse-region (start stop)
+  "Re-apply all applicable submode classes between START and STOP.
+Clears all current submode regions, reapplies all past interactive
+mmm-ification, and applies `mmm-classes' and mode-extension classes."
+  (interactive "r")
+  (message "MMM-ifying region...")
+  (mmm-apply-all :start start :stop stop)
+  (message "MMM-ifying region...done"))
+
+(defun mmm-parse-block (&optional lines)
+  "Re-parse LINES lines before and after point \(default 1).
+Clears all current submode regions, reapplies all past interactive
+mmm-ification, and applies `mmm-classes' and mode-extension classes.
+
+This command is intended for use when you have just typed what should
+be the delimiters of a submode region and you want to create the
+region. However, you may want to look into the various types of
+delimiter auto-insertion that MMM Mode provides. See, for example,
+`mmm-insert-region'."
+  (interactive "p")
+  (message "MMM-ifying block...")
+  (destructuring-bind (start stop) (mmm-get-block lines)
+    (when (< start stop)
+      (mmm-apply-all :start start :stop stop)))
+  (message "MMM-ifying block...done"))
+
+(defun mmm-get-block (lines)
+  (let ((inhibit-point-motion-hooks t))
+    (list (save-excursion
+            (forward-line (- lines))
+            (beginning-of-line)
+            (point))
+          (save-excursion
+            (forward-line lines)
+            (end-of-line)
+            (point)))))
+
+;;}}}
+;;{{{ Clear Submode Regions
+
+;; See also `mmm-clear-history' which is interactive.
+
+(defun mmm-clear-current-region ()
+  "Deletes the submode region point is currently in, if any."
+  (interactive)
+  (delete-overlay (mmm-overlay-at (point) 'all)))
+
+(defun mmm-clear-regions (start stop)
+  "Deletes all submode regions from START to STOP."
+  (interactive "r")
+  (mmm-clear-overlays start stop))
+
+(defun mmm-clear-all-regions ()
+  "Deletes all submode regions in the current buffer."
+  (interactive)
+  (mmm-clear-overlays))
+
+;;}}}
+;;{{{ Reparse Current Region
+
+(defun mmm-reparse-current-region ()
+  "Clear and reparse the area of the current submode region.
+Use this command if a submode region's boundaries have become wrong."
+  (interactive)
+  (let ((ovl (mmm-overlay-at (point) 'all)))
+    (when ovl
+      (let ((beg (save-excursion
+                   (goto-char (mmm-front-start ovl))
+                   (forward-line -1)
+                   (point)))
+            (end (save-excursion
+                   (goto-char (mmm-back-end ovl))
+                   (forward-line 1)
+                   (point))))
+        (mmm-parse-region beg end)))))
+
+;;}}}
+;;{{{ End Current Region
+
+(defun* mmm-end-current-region (&optional arg)
+  "End current submode region.
+If ARG is nil, end it at the most appropriate place, usually its
+current back boundary. If ARG is non-nil, end it at point. If the
+current region is correctly bounded, the first does nothing, but the
+second deletes that delimiter as well.
+
+If the region's BACK property is a string, it is inserted as above and
+the overlay moved if necessary. If it is a function, it is called with
+two arguments--the overlay, and \(if ARG 'middle t)--and must do the
+entire job of this function."
+  (interactive "P")
+  (let ((ovl (mmm-overlay-at)))
+    (when ovl
+      (combine-after-change-calls
+        (save-match-data
+          (save-excursion
+            (when (mmm-match-back ovl)
+              (if arg
+                  (replace-match "")
+                (return-from mmm-end-current-region)))))
+        (let ((back (overlay-get ovl 'back)))
+          (cond ((stringp back)
+                 (save-excursion
+                   (unless arg (goto-char (overlay-end ovl)))
+                   (save-excursion (insert back))
+                   (move-overlay ovl (overlay-start ovl) (point))))
+                ((functionp back)
+                 (funcall back ovl (if arg 'middle t))))))
+      (mmm-refontify-maybe (save-excursion (forward-line -1) (point))
+                           (save-excursion (forward-line 1) (point))))))
+
+;;}}}
+;;{{{ Insert regions by keystroke
+
+;; This is the "default" binding in the MMM Mode keymap. Keys defined
+;; by classes should be control keys, to avoid conflicts with MMM
+;; commands.
+(defun mmm-insert-region (arg)
+  "Insert a submode region based on last character in invoking keys.
+Keystrokes after `mmm-mode-prefix-key' which are not bound to an MMM
+Mode command \(see `mmm-command-modifiers') are passed on to this
+function. If they have the modifiers `mmm-insert-modifiers', then they
+are looked up, sans those modifiers, in all current submode classes to
+find an insert skeleton. For example, in Mason, `p' \(with appropriate
+prefix and modifiers) will insert a <%perl>...</%perl> region."
+  (interactive "P")
+  (let* ((seq (this-command-keys))
+         (event (aref seq (1- (length seq))))
+         (mods (event-modifiers event))
+         (key (mmm-event-key event)))
+    (if (subsetp mmm-insert-modifiers mods)
+        (mmm-insert-by-key
+         (append (set-difference mods mmm-insert-modifiers)
+                 key)
+         arg))))
+
+(defun mmm-insert-by-key (key &optional arg)
+  "Insert a submode region based on event KEY.
+Inspects all the classes of the current buffer to find a matching
+:insert key sequence. See `mmm-classes-alist'. ARG, if present, is
+passed on to `skeleton-proxy-new' to control wrapping.
+
+KEY must be a list \(MODIFIERS... . BASIC-KEY) where MODIFIERS are
+symbols such as shift, control, etc. and BASIC-KEY is a character code
+or a symbol such as tab, return, etc. Note that if there are no
+MODIFIERS, the dotted list becomes simply BASIC-KEY."
+  (multiple-value-bind (class skel str) (mmm-get-insertion-spec key)
+    (when skel
+      (let ((after-change-functions nil))
+        ;; XEmacs' skeleton doesn't manage positions by itself, so we
+        ;; have to do it.
+        (if mmm-xemacs (setq skeleton-positions nil))
+        (skeleton-proxy-new skel str arg)
+        (destructuring-bind (back end beg front) skeleton-positions
+          ;; TODO: Find a way to trap invalid-parent signals from
+          ;; make-region and undo the skeleton insertion.
+          (let* ((match-submode (plist-get class :match-submode))
+                 (front-str (buffer-substring front beg))
+                 (back-str (buffer-substring end back))
+                 (submode
+                  (if match-submode
+                      (mmm-save-all (funcall match-submode front-str))
+                    (plist-get class :submode)))
+                 (match-face (plist-get class :match-face))
+                 (face
+                  (cond ((functionp match-face)
+                         (mmm-save-all
+                          (funcall match-face front-str)))
+                        (match-face
+                         (cdr (assoc front-str match-face)))
+                        (t
+                         (plist-get class :face)))))
+            (setq submode (mmm-modename->function submode))
+            (mmm-make-region
+             submode beg end :front front-str :back back-str
+             :face face
+;;;             :beg-sticky (plist-get class :beg-sticky)
+;;;             :end-sticky (plist-get class :end-sticky)
+             :beg-sticky t :end-sticky t
+             :creation-hook (plist-get class :creation-hook))
+            (mmm-enable-font-lock submode)))))))
+
+(defun mmm-get-insertion-spec (key &optional classlist)
+  "Get the insertion info for KEY from all classes in CLASSLIST.
+Return \(CLASS SKEL STR) where CLASS is the class spec a match was
+found in, SKEL is the skeleton to insert, and STR is the argument.
+CLASSLIST defaults to the return value of `mmm-get-all-classes',
+including global classes."
+  (loop for classname in (or classlist (mmm-get-all-classes t))
+        for class = (mmm-get-class-spec classname)
+        for inserts = (plist-get class :insert)
+        for skel = (cddr (assoc key inserts))
+        with str
+        ;; If SKEL is a dotted pair, it means call another key's
+        ;; insertion spec with an argument.
+        unless (consp (cdr skel))
+        do (setq str (cdr skel)
+                 skel (cddr (assoc (car skel) inserts)))
+        if skel return (list class skel str)
+        ;; If we have a group class, recurse.
+        if (plist-get class :classes)
+           if (mmm-get-insertion-spec key it)
+              return it
+           else
+              return nil))
+
+;;}}}
+;;{{{ Help on Insertion
+
+(defun mmm-insertion-help ()
+  "Display help on currently available MMM insertion commands."
+  (interactive)
+  (with-output-to-temp-buffer "*Help*"
+    (princ "Available MMM Mode Insertion Commands:\n")
+    (princ "Key             Inserts\n")
+    (princ "---             -------\n\n")
+    (mapcar #'mmm-display-insertion-key
+            (mmm-get-all-insertion-keys))))
+
+(defun mmm-display-insertion-key (spec)
+  "Print an insertion binding to standard output.
+SPEC should be \(KEY NAME ...) where KEY is an insertion key and NAME
+is a symbol naming the insertion."
+  (let* ((str (make-string 16 ?\ ))
+         ;; This gets us a dotted list, because of the way insertion
+         ;; keys are specified.
+         (key (append mmm-insert-modifiers (car spec)))
+         (lastkey (nthcdr (max (1- (safe-length key)) 0) key)))
+    ;; Now we make it a true list
+    (if (consp key)
+        (setcdr lastkey (list (cdr lastkey)))
+      (setq key (list key)))
+    ;; Get the spacing right
+    (store-substring str 0
+      (key-description
+       (apply #'vector (append mmm-mode-prefix-key (list key)))))
+    (princ str)
+    ;; Now print the binding symbol
+    (princ (cadr spec))
+    (princ "\n")))
+
+(defun mmm-get-all-insertion-keys (&optional classlist)
+  "Return an alist of all currently available insertion keys.
+Elements look like \(KEY NAME ...) where KEY is an insertion key and
+NAME is a symbol naming the insertion."
+  (remove-duplicates
+   (loop for classname in (or classlist (mmm-get-all-classes t))
+         for class = (mmm-get-class-spec classname)
+         append (plist-get class :insert) into keys