emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master b73a727 018/433: Added to CVS (formerly not under RCS).


From: Dmitry Gutov
Subject: [elpa] master b73a727 018/433: Added to CVS (formerly not under RCS).
Date: Thu, 15 Mar 2018 19:43:27 -0400 (EDT)

branch: master
commit b73a727a310be1b21a8401d48ccb514ec97c5f72
Author: mas <mas>
Commit: mas <mas>

    Added to CVS (formerly not under RCS).
---
 AUTHORS     |   3 +
 ChangeLog   | 373 +++++++++++++++++++++++
 NEWS        |  62 ++++
 README      |  74 +++++
 TODO        |  63 ++++
 elisp-comp  |  55 ++++
 mmm.texinfo | 962 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 1592 insertions(+)

diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..b7a996c
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,3 @@
+MMM Mode was designed and written by Michael Abraham Shulman
+<address@hidden>.  The original inspiration came from mmm.el
+for XEmacs by Gongquan Chen <address@hidden>.
\ No newline at end of file
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..d7dcabb
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,373 @@
+2000-05-03  Michael Abraham Shulman  <address@hidden>
+
+       * mmm-mason.el: Added dependencies on mmm-compat and mmm-vars.
+
+2000-04-30  Michael Abraham Shulman  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * All: Started using RCS.
+
+2000-04-27  Michael Abraham Shulman  <address@hidden>
+
+       * mmm-sample.el (mmm-javascript-mode): Created customization
+       variable to select mode to use for javascript regions.
+
+2000-03-26  Michael Abraham Shulman  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
+               
+       * 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  <address@hidden>
+       
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
+        
+       * Version 0.3.6c released.
+        
+       * mmm-mode.el: Added comment about putting autohandlers and
+       dhandlers in html-mode.
+
+1999------  Michael Abraham Shulman  <address@hidden>
+        
+       * Version 0.3.6b released.
+        
+       * mmm-mode.el: Added comment about `psgml-mode' thanks to Michael
+       Alan Dorman.
+
+1999------  Michael Abraham Shulman  <address@hidden>
+        
+       * Version 0.3.6a released.
+
+       * mmm-mode.el: Loaded CL at compile-time to prevent execution of
+       macro arguments.
+
+1999------  Michael Abraham Shulman  <address@hidden>
+        
+       * 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  <address@hidden>
+        
+       * Version 0.3.5a released.
+
+       * mmm-mode.el (mmm-ify-by-all): no longer re-fontifies buffers
+       with no submodes.
+
+1999------  Michael Abraham Shulman  <address@hidden>
+        
+       * 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  <address@hidden>
+        
+       * 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  <address@hidden>
+        
+       * 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  <address@hidden>
+        
+       * 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  <address@hidden>
+        
+       * 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  <address@hidden>
+        
+       * 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  <address@hidden>
+
+       * Version 0.2.2a released.
+        
+       * mmm-mode.el: Fixed bug.
+
+1999-11-18  Michael Abraham Shulman  <address@hidden>
+        
+       * 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  <address@hidden>
+        
+       * 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  <address@hidden>
+       
+       * 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 <address@hidden>, so I have continued his
+       version-numbering.
+        
+1999-01-12  Gongquan Chen <address@hidden>
+        
+       * Version 0.11 released.
+
+       * mmm.el: Fixed doc-strings and style. Thanks to comments from
+       Jari Aalto <address@hidden>
+
+1999-01-11  Gongquan Chen <address@hidden>
+       
+       * Version 0.10 released.
+
+       * mmm.el: Initial release of mmm.el on comp.emacs.xemacs
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..a80b7ff
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,62 @@
+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 address@hidden
+
+* 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.
diff --git a/README b/README
new file mode 100644
index 0000000..b990d24
--- /dev/null
+++ b/README
@@ -0,0 +1,74 @@
+
+                        MMM Mode Version 0.3.8
+                        ======================
+
+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.  To
+  install mmm-mode in the standard locations, unpack the archive, `cd'
+  to the mmm-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.
+
+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://kurukshetra.cjb.net/elisp.  Check that you have the latest
+  version before reporting a bug.
+
+REPORTING BUGS
+
+  Please report bugs to address@hidden  Comments,
+  questions, and suggestions are also welcome.
+
+CONTACT INFO
+
+  MMM Mode is written and maintained by Michael Abraham Shulman
+  <address@hidden>.  Please email me if you would like to be
+  added to my very-low-volume MMM Mode mailing list.  The list gets
+  announcements of new releases, and might one day turn into an actual
+  mailing list for discussion of features.
+
+  Thanks for trying MMM Mode!
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..5d8fc69
--- /dev/null
+++ b/TODO
@@ -0,0 +1,63 @@
+Hey Emacs, this is a -*-text-*- file!
+
+                       To Do List for MMM Mode
+                       =======================
+
+Improve font-locking somehow.  Maybe narrow the region before
+fontifying, maybe save parsing state variables from `font-lock' and/or
+`parse-partial-sexp' for each region, maybe even advise the parsing
+functions.
+
+Inserting one-line perl sections isn't sticky.  Other sections are
+getting un-stickified too easily, and re-parsing current region
+doesn't work as it should.
+
+Trap paragraph motion commands to stop at submode boundaries?
+
+If we could trap parse-partial-sexp (and friends?) somehow, maybe
+font-lock and indentation would work better.
+
+Add JDE-mode, JavaSQL (see +mmm), Embperl, Eperl, ASP, etc.
+
+Use symbol properties rather than `mmm-classes-alist'?  Maybe once its
+documentation is in the info file.
+
+How about this? Whenever text is inserted anywhere in the buffer:
+1. If in or after a region (with hanging back?), scan for its back.
+2. If before a region with hanging front, scan for its front?
+3. Scan the inserted text for new regions.
+Mess with the order of scanning for stuff. Of course this could get
+tricky with nested regions, plus we don't want to be too slow while
+people are just typing. Maybe just scan changes of length >1?
+
+Use `mmm-looking-back-at' to auto-detect new submode regions in
+`after-change-functions'. Say we type "<%" and we're suddenly in a
+CPerl region, until we type "%>". Actually, the two-character ending
+delimiter makes that tricky. It would probably be nicer all around to
+just automatically insert the ending delimiter when the beginning one
+is detected, but that must be user-configurable.
+
+When we hit return anywhere in a Mason %-line, it should end the
+submode region. If C-j ended it and began a new one on the next line,
+that would also be nice. This is a rather Mason-specific thing, so
+maybe do it in that class hook. But other classes might have similar
+single-line regions. Add a new submode class argument, such as KEYMAP,
+or even ONE-LINE?
+
+How about allowing nested submode regions? A submode class could
+specify its "parent" submode class. 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. Similarly, eval-elisp could have one class to find
+the Local Variables list, then another within it.
+
+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.
+
+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.
diff --git a/elisp-comp b/elisp-comp
new file mode 100755
index 0000000..76f5d60
--- /dev/null
+++ b/elisp-comp
@@ -0,0 +1,55 @@
+#!/bin/sh
+# Copyright (C) 1995 Free Software Foundation, Inc.
+# Fran�ois Pinard <address@hidden>, 1995.
+#
+# This program 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 program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This script byte-compiles all `.el' files which are part of its
+# arguments, using GNU Emacs, and put the resulting `.elc' files into
+# the current directory, so disregarding the original directories used
+# in `.el' arguments.
+#
+# This script manages in such a way that all Emacs LISP files to
+# be compiled are made visible between themselves, in the event
+# they require or load-library one another.
+
+# This script was modified by Michael Abraham Shulman
+# <address@hidden> not to create a temporary directory, so
+# that elisp files not given on the command line at the same time,
+# the way Automake *actually* uses this script, can load each other.
+
+if test $# = 0; then
+   echo 1>&2 "No files given to $0"
+   exit 1
+else
+   if test -z "$EMACS" || test "$EMACS" = "t"; then
+      # Value of "t" means we are running in a shell under Emacs.
+      # Just assume Emacs is called "emacs".
+      EMACS=emacs
+   fi
+
+#   tempdir=elc.$$
+#   mkdir $tempdir
+#   cp $* $tempdir
+#   cd $tempdir
+
+#   echo "elisp-comp called on $*"
+   echo "(setq load-path (cons nil load-path))" > script
+   $EMACS -q -batch -l script -f batch-byte-compile $*
+#   mv *.elc ..
+
+#   cd ..
+#   rm -fr $tempdir
+fi
diff --git a/mmm.texinfo b/mmm.texinfo
new file mode 100644
index 0000000..1039ad4
--- /dev/null
+++ b/mmm.texinfo
@@ -0,0 +1,962 @@
+\input texinfo
address@hidden %**start of header
address@hidden mmm.info
address@hidden MMM Mode Manual
address@hidden %**end of header
address@hidden vr fn
+
address@hidden version.texi
+
address@hidden
+This is edition @value{EDITION} of the MMM Mode Manual, last updated
address@hidden It documents version @value{VERSION} of MMM Mode.
+
+Copyright 2000 Michael Abraham Shulman.
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+     
address@hidden
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries a copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+
address@hidden ignore
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+sections entitled ``Copying'' and ``GNU General Public License'' are
+included exactly as in the original, and provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+     
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation
+approved by the Free Software Foundation.
+
address@hidden ifinfo
+
address@hidden
address@hidden MMM Mode Manual
address@hidden Multiple Major Modes for Emacs
address@hidden Edition @value{EDITION}
address@hidden @value{UPDATED}
address@hidden Michael Abraham Shulman
address@hidden
address@hidden 0pt plus 1filll
+Copyright @copyright{} 2000 Michael Abraham Shulman.
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+     
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+sections entitled ``Copying'' and ``GNU General Public License'' are
+included exactly as in the original, and provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+     
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation
+approved by the Free Software Foundation.
+
address@hidden titlepage
+
address@hidden
address@hidden Top, Overview, (dir), (dir)
address@hidden MMM Mode
+
+MMM Mode is a minor mode for Emacs which allows Multiple Major Modes to
+coexist in a single buffer.
+
+This is edition @value{EDITION} of the MMM Mode Manual, last updated
address@hidden, which documents version @value{VERSION} of MMM Mode.
+
address@hidden ifinfo
+
address@hidden
+* Overview::                What MMM Mode is and how it can be used.
+* Basic Concepts::          A simple explanation of how it works.
+* Installation::            How to install MMM Mode.
+* Quick Start::             Getting started using MMM Mode quickly.
+
+MMM Mode Basics
+
+* MMM Minor Mode::          The Emacs minor mode that manages it all.
+* Submode Classes::         What they are and how to use them.
+* Selecting Classes::       How MMM Mode knows what classes to use.
+* Insertion::               Inserting new submode regions automatically.
+* Re-parsing::              Re-scanning for submode regions.
+* Interactive::             Adding submode regions manually.
+* Global Mode::             Turning MMM Mode on automatically.
+
+Customizing MMM Mode
+
+* Submode Faces::           How submode regions are highlighted.
+* Mode Line::               What is displayed in the mode line.
+* Key Bindings::            Customizing the MMM Mode key bindings.
+* Local Variables::         What local variables are saved for submodes.
+* Hooks::                   How to make MMM Mode run your code.
+
+Supplied Submode Classes
+
+* Mason::                   Mason syntax for server-side Perl in HTML.
+* Eval-Elisp::              Emacs Lisp in @code{eval} file variables.
+* HTML Here-documents::     HTML in Perl here-documents.
+* Javascript::              Javascript embedded in HTML.
+* Embedded CSS::            CSS Styles embedded in HTML.
+* HTML in PL/SQL::          HTML output by PL/SQL @code{htp.p} methods.
+
+Indices
+
+* Concept Index::           Index of MMM Mode Concepts.
+* Function Index::          Index of functions and variables of MMM Mode.
+* Keystroke Index::         Index of key bindings in MMM Mode.
+
+Writing Submode Classes
address@hidden Put stuff here
+
address@hidden
+ --- The Detailed Node Listing ---
+
+The MMM Minor Mode
+
+* Enabling MMM Mode::       Turning MMM Mode on and off.
+* MMM Mode Keys::           Default key bindings in MMM Mode.
+
+How MMM Mode selects submode classes
+
+* File Classes::            Classes for a single file.
+* Mode-Ext Classes::        Classes for a given mode or extension.
+
+MMM Global Mode
+
+* Major Mode Hook::         Using MMM's Major Mode Hook
+
address@hidden detailmenu
address@hidden menu
+
address@hidden Overview, Basic Concepts, Top, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Overview of MMM Mode
address@hidden overview of mmm-mode
address@hidden mmm-mode, overview of
+
+MMM Mode is a minor mode for Emacs which allows Multiple Major Modes to
+coexist in a single buffer. The name is an abbreviation of `Multiple
+Major Modes'@footnote{The name is derived from @file{mmm.el} for XEmacs
+by Gongquan Chen <chen@@posc.org>, from which MMM Mode was adapted.}. A
+major mode is a customization of Emacs for editing a certain type of
+text, such as code for a specific programming language. @xref{Major
+Modes, , , emacs, The Emacs Manual}, for details.
+
+MMM Mode is a general extension to Emacs which has many uses. Currently,
+its most common usage is to edit Mason components. Mason is a
+``Perl-based web site development and delivery engine'' which executes
+Perl code embedded in HTML and other types of documents. For more
+information, see @url{http://www.masonhq.com}. MMM Mode comes with a
+submode class (@pxref{Submode Classes}) for editing Mason components
+(@pxref{Mason}).
+
+More generally, however, MMM Mode is useful whenever one file contains
+text in two or more programming languages, or that should be in two or
+more different modes. For example, CGI scripts written in any language,
+such as Perl or PL/SQL, may want to output verbatim HTML, and the writer
+of such scripts may want to use Emacs' html-mode to edit this HTML code.
+HTML itself can also contain embedded languages such as Javascript and
+CSS styles, for which Emacs has different major modes. Emacs also allows
+files of any type to contain `local variables', which can include Emacs
+Lisp code to be evaluated. @xref{File Variables, , , emacs, The Emacs
+Manual}. It may be easier to edit this code in Emacs Lisp mode than in
+whatever mode is used for the rest of the file.
+
+
address@hidden Basic Concepts, Installation, Overview, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Basic Concepts
address@hidden dominant major mode
address@hidden major mode, dominant
address@hidden default major mode
address@hidden major mode, default
address@hidden submode regions
address@hidden regions, submode
address@hidden overlays, submode
address@hidden submode overlays
address@hidden mmm-ification
+
+The way MMM Mode works is as follows. Each buffer has a @dfn{dominant}
+or @dfn{default} major mode, which is chosen as major modes normally
+are: the user can set it interactively, or it can be chosen
+automatically with `auto-mode-alist' (@pxref{Choosing Modes, , , emacs,
+The Emacs Manual}). Within the file, MMM Mode creates @dfn{submode
+regions} within which other major modes are in effect. While the point
+is in a submode region, the following changes occur:
+
address@hidden
address@hidden
+The local keymap is that of the submode. This means the key bindings for
+the submode are available, while those of the dominant mode are not.
address@hidden
+The mode line (@pxref{Mode Line, , , emacs, The Emacs Manual}) changes
+to show which submode region is active. This can be configured; see
address@hidden Line}.
address@hidden
+The major mode menu, both on the menu bar and the mouse popup, are that
+of the submode.
address@hidden
+Some local variables of the submode shadow those of the default mode
+(@pxref{Local Variables}). For the user, this serves to help make Emacs
+behave as if the submode were the major mode.
address@hidden
+The syntax table and indentation are those of the submode.
address@hidden
+Font-lock (@pxref{Font Lock, , , emacs, The Emacs Manual}) fontifies
+correctly for the submode.
address@hidden
+The submode regions are highlighted by a background color
+(@pxref{Submode Faces}), by default a light gray.
+
address@hidden enumerate
+
+The submode regions are represented internally by Emacs Lisp objects
+known as @dfn{overlays}. Some of the above are implemented by overlay
+properties, and others are updated by an MMM Mode function in
+`post-command-hook'. You don't need to know this to use MMM Mode, but it
+may make any error messages you come across more understandable.
address@hidden, , , elisp, The GNU Emacs Lisp Reference Manual}, for
+more information on overlays.
+
+Because overlays are not saved with a file, every time a file is opened,
+they must be created.  Creating submode regions is occasionally referred
+to as @dfn{mmm-ification}.  (I've never had occasion to pronounce this,
+but if I did I would probably say `mummification'. Like what they did in
+ancient Egypt.)  You can mmm-ify a buffer interactively, but most often
+MMM Mode will find and create submode regions automatically based on a
+buffer's file extension, dominant mode, or local variables.
+
+
address@hidden Installation, Quick Start, Basic Concepts, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Installing MMM Mode
+
+MMM Mode has a standard installation process.  See the file INSTALL for
+generic information on this process.  To summarize, unpack the archive,
address@hidden to the created MMM Mode directory, type @samp{./configure},
+then @samp{make}, then @samp{make install}.  If all goes correctly, this
+will compile the MMM Mode elisp files, install them in your local
+site-lisp directory, and install the MMM Mode info file @file{mmm.info}
+in your local info directory.
+
+Now you need to configure your Emacs initialization file (usually
address@hidden/.emacs}) to use MMM Mode.  First, Emacs has to know where to
+find MMM Mode.  In other words, the MMM Mode directory has to be in
address@hidden  This can be done in the parent directory's
address@hidden file, or in the init file with a line such as:
+
address@hidden
+(add-to-list 'load-path "/path/to/site-lisp/mmm/")
address@hidden lisp
+
+Once @code{load-path} is configured, MMM Mode must be loaded.  You can
+load all of MMM Mode with the line
+
address@hidden
+(require 'mmm-mode)
address@hidden lisp
+
address@hidden
+but if you use MMM Mode only rarely, it may not be desirable to load all
+of it at the beginning of every editing session.  You can load just
+enough of MMM Mode so it will turn itself on when necessary and load the
+rest of itself, by using instead the line
+
address@hidden
+(require 'mmm-auto)
address@hidden lisp
+
address@hidden
+in your initialization file.
+
+One more thing you may want to do right now is to set the variable
address@hidden  If this variable is @code{nil} (the default),
+MMM Mode will never turn itself on.  If it is @code{t}, MMM Mode will
+turn itself on in every buffer.  Probably the most useful value for it,
+however, is the symbol @code{maybe} (actually, anything that is not
address@hidden and not @code{t}), which causes MMM Mode to turn itself on in
+precisely those buffers where it would be useful.  You can do this with
+a line such as:
+
address@hidden
+(setq mmm-global-mode 'maybe)
address@hidden lisp
+
address@hidden
+in your initialization file.  @xref{Global Mode}, for more detailed
+information.
+
+
address@hidden Quick Start, MMM Minor Mode, Installation, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Getting Started Quickly
+
+Perhaps the simplest way to create submode regions is to do it
+interactively by specifying a region. First you must turn MMM Mode
+on---say, with @kbd{M-x mmm-mode}---then place point and mark around the
+area you want to make into a submode region, type @kbd{C-c % C-r}, and
+enter the desired major mode. @xref{Interactive}, for more details.
+
+A better way to add submode regions is by using submode classes, which
+store a lot of useful information for MMM Mode about how to add and
+manipulate the regions created.  @xref{Submode Classes}, for more
+details.  There are several sample submode classes that come with MMM
+Mode, which are documented later in this manual.  Look through these and
+determine if one of them fits your needs.  If so, I suggest reading the
+comments on that mode.  Then come back here to find out to use it.
+
+To apply a submode class to a buffer interactively, turn MMM Mode on as
+above, then type @kbd{C-c % C-c} and enter the name of the class.
+Submode regions should be added automatically, if there are any regions
+in the buffer appropriate to the submode class.
+
+If you want a given file to always use a given submode class, you can
+express this in a file variable: add a line containing the string
address@hidden mmm-classes: @var{class} -*-} at the top of the file.
address@hidden Variables, , , emacs, The Emacs Manual}, for more information
+and other methods. Now whenever MMM Mode is turned on in that file, it
+will be mmm-ified according to @var{class}. If @code{mmm-global-mode} is
+non-nil, then MMM Mode will turn itself on whenever a file with a
address@hidden local variable is opened. @xref{Global Mode}, for more
+information.
+
+If you want a submode class to apply to @emph{all} files in a certain
+major mode or with a certain extension, add a line such as this to your
+initialization file:
+
address@hidden
+(mmm-add-mode-ext-class @var{mode} @var{extension} @var{class})
address@hidden lisp
+
address@hidden
+After this call, any file opened whose name matches the regular
+expression @var{extension} @emph{and} whose default mode is @var{mode}
+will be automatically mmm-ified according to @var{class} (assuming
address@hidden is non-nil). If one of @var{extension} or
address@hidden is @code{nil}, a file need only satisfy the other one to be
+mmm-ified.
+
+You can now read the rest of this manual to learn more about how MMM
+Mode works and how to configure it to your preferences.  If none of the
+supplied submode classes fit your needs, then you can try to write your
+own.  There will eventually be a chapter on how to do that, but for now,
+see the documentation for the variable `mmm-classes-alist'.
+
address@hidden @xref{Writing Classes}, for more information.
+
address@hidden MMM Minor Mode, Submode Classes, Quick Start, Top
address@hidden  node-name,  next,  previous,  up
address@hidden The MMM Minor Mode
address@hidden mode, mmm minor
address@hidden minor mode, mmm
address@hidden mmm minor mode
+
+An Emacs minor mode is an optional feature which can be turned on or off
+in a given buffer, independently of the major mode. @xref{Minor Modes, ,
+, emacs, The Emacs Manual}. MMM Mode is implemented as a minor mode
+which manages the submode regions. This minor mode must be turned on in
+a buffer for submode regions to be effective. When activated, the MMM
+Minor mode is denoted by @samp{MMM} in the mode line (@pxref{Mode
+Line}).
+
address@hidden
+* Enabling MMM Mode::                        Turning MMM Mode on and off.
+* MMM Mode Keys::                        Default key bindings in MMM Mode.
address@hidden menu
+
+
address@hidden Enabling MMM Mode, MMM Mode Keys, MMM Minor Mode, MMM Minor Mode
address@hidden  node-name,  next,  previous,  up
address@hidden Enabling MMM Mode
address@hidden mmm mode, turning on
address@hidden mmm mode, turning off
address@hidden turning on mmm mode
address@hidden turning off mmm mode
address@hidden mmm mode, enabling
address@hidden mmm mode, disabling
address@hidden enabling mmm mode
address@hidden disabling mmm mode
+
+If @code{mmm-global-mode} is address@hidden (@pxref{Global Mode}),
+then the MMM minor mode will be turned on automatically whenever a file
+with associated submode classes is opened (@pxref{Selecting Classes}).
+It is also turned on by interactive mmm-ification (@pxref{Interactive}),
+although the interactive commands do not have key bindings when it is
+not on and must be invoked via @kbd{M-x}. You can also turn it on (or
+off) manually with @kbd{M-x mmm-mode}, in which case it applies all
+submode classes associated with the buffer. Turning MMM Mode off
+automatically removes all submode regions from the buffer.
+
address@hidden Command mmm-mode arg
+Toggle the state of MMM Mode in the current buffer. If @var{arg} is
+supplied, turn MMM Mode on if and only if @var{arg} is positive.
address@hidden deffn
+
address@hidden mmm-mode-on
+Turn MMM Mode on unconditionally in the current buffer.
address@hidden defun
+
address@hidden mmm-mode-off
+Turn MMM Mode off unconditionally in the current buffer.
address@hidden defun
+
address@hidden mmm-mode
+This variable represents whether MMM Mode is on in the current buffer.
+Do not set this variable directly; use one of the above functions.
address@hidden defvar
+
+
address@hidden MMM Mode Keys,  , Enabling MMM Mode, MMM Minor Mode
address@hidden  node-name,  next,  previous,  up
address@hidden Key Bindings in MMM Mode
address@hidden mmm mode key bindings
address@hidden key bindings in mmm mode
address@hidden mmm-insertion-help
address@hidden C-c % h
+
+When MMM Mode is on, it defines a number of key bindings. By default,
+these are bound after the prefix sequence @kbd{C-c %}. Minor mode
+keymaps are supposed to use @kbd{C-c @var{punctuation}} sequences, and I
+find this one to be a good mnemonic because @samp{%} is used by Mason to
+denote special tags. This prefix key can be customized; @ref{Key
+Bindings}.
+
+There are two types of key bindings in MMM Mode: @dfn{commands} and
address@hidden Command bindings run MMM Mode interactive functions to
+do things like re-parse the buffer or end the current submode region,
+and are defined statically as normal Emacs key-bindings. Insertion
+bindings insert submode region skeletons with delimiters into the
+buffer, and are defined dynamically, according to which submode classes
+(@pxref{Submode Classes}) are in effect, via a keymap default binding.
+
+To distinguish between the two, MMM Mode uses distinct modifier keys for
+each. By default, command bindings use the control key (e.g. @kbd{C-c %
+C-b} re-parses the buffer), and insertion bindings do not (e.g. @kbd{C-c
+% p}, when the Mason class is in effect, inserts a
address@hidden<%perl>...</%perl>} region). This makes the command bindings
+different from in previous versions, however, so the variable
address@hidden is provided. If this variable is set to `t'
+before MMM Mode is loaded, the bindings will be reversed: insertion
+bindings will use the control key and command bindings will not.
+
+Normally, Emacs gives help on a prefix command if you type @kbd{C-h}
+after that command (e.g. @kbd{C-x C-h} displays all key bindings
+starting with @kbd{C-x}). Because of how insertion bindings are
+implemented dynamically with a default binding, they do not show up when
+you hit @kbd{C-c % C-h}. For this reason, MMM Mode defines the command
address@hidden % h} which displays a list of all currently valid insertion key
+sequences. If you use the defaults for command and insertion bindings,
+the @kbd{C-h} and @kbd{h} should be mnemonic.
+
+In the rest of this manual, I will assume you are using the defaults for
+the mode prefix (@kbd{C-c %}) and the command and insertion modifiers.
+You can customize them, however; @ref{Key Bindings}.
+
+
address@hidden Submode Classes, Selecting Classes, MMM Minor Mode, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Understanding Submode Classes
address@hidden submode classes
address@hidden classes, submode
+
+A submode class represents a ``type'' of submode region. It specifies
+how to find the regions, what their delimiters look like, what submode
+they should be, how to insert them, and how they behave in other ways.
+It is represented by a symbol, such as @code{mason} or
address@hidden
+
+For example, in the Mason set of classes, there is one class
+representing all @samp{<%...%>} inline Perl regions, and one
+representing regions such as @samp{<%perl>...</%perl>},
address@hidden<%init>...</%init>}, and so on. These are different to Mason, but
+to Emacs they are all just Perl sections, so they are covered by the
+same submode class.
+
+But it would be tedious if whenever we wanted to use the Mason classes,
+we had to specify both of these. (Actually, this is a simplification:
+there are some half a dozen Mason submode classes.) So submode classes
+can also ``group'' others together, and we can refer to the @code{mason}
+class and mean all of them.
+
+The way a submode class is used is to @dfn{apply} it to a buffer. This
+scans the buffer for regions which should be submode regions according
+to that class, and also remembers the class for later, so that new
+submode regions can be inserted and scanned for later.
+
+
address@hidden Selecting Classes, Insertion, Submode Classes, Top
address@hidden  node-name,  next,  previous,  up
address@hidden How MMM Mode selects submode classes
+
+Submode classes that apply to a buffer come from three sources:
+mode/extension-associated classes, file-local classes, and interactive
+MMM-ification (@pxref{Interactive}). Whenever MMM Mode is turned on in a
+buffer (@pxref{MMM Minor Mode}, and @ref{Global Mode}), it inspects the
+value of two variables to determine which classes to automatically apply
+to the buffer. This covers the first two sources; the latter is covered
+in a later chapter.
+
address@hidden
+* File Classes::                                Classes for a single file.
+* Mode-Ext Classes::                                Classes for a given mode 
or extension.
address@hidden menu
+
+
address@hidden File Classes, Mode-Ext Classes, Selecting Classes, Selecting 
Classes
address@hidden  node-name,  next,  previous,  up
address@hidden File-Local Submode Classes
+
address@hidden mmm-classes
+This variable is always buffer-local when set. Its value should be
+either a single symbol or a list of symbols. Each symbol represents a
+submode class that is applied to the buffer.
address@hidden defvar
+
address@hidden is usually set in a file local variables list.
address@hidden Variables, , , emacs, The Emacs Manual}. The easiest way to
+do this is for the first line of the file to contain the string
address@hidden mmm-classes: @var{classes} -*-}, where @var{classes} is the
+desired value of @code{mmm-classes} for the file in question. It can
+also be done with a local variables list at the end of the file.
+
+
address@hidden Mode-Ext Classes,  , File Classes, Selecting Classes
address@hidden  node-name,  next,  previous,  up
address@hidden Submode Classes Associated with Modes and Extensions
+
address@hidden mmm-mode-ext-classes-alist
+This global variable associates certain submode classes with major modes
+and/or file extensions. Its value is a list of elements of the form
address@hidden(@var{mode} @var{ext} @var{class})}. Any buffer whose major mode
+is @var{mode} (a symbol) @emph{and} whose file name matches @var{ext} (a
+regular expression) will automatically have the submode class
address@hidden applied to it.
+
+If @var{mode} is @code{nil}, then only @var{ext} is considered to
+determine if a buffer fits the criteria, and vice versa. Thus if both
address@hidden and @var{ext} are nil, then @var{class} is applied to
address@hidden buffers in which MMM Mode is on. Note that @var{ext} can be
+any regular expression, although its name indicates that it most often
+refers to the file extension.
+
+If @var{class} is the symbol @code{t}, then no submode class is actually
+applied for this association. However, if @code{mmm-global-mode} is
address@hidden and address@hidden, MMM Mode will be turned on in matching
+buffers even if there are no actual submode classes being applied.
address@hidden Mode}.
address@hidden defopt
+
address@hidden mmm-add-mode-ext-class mode ext class
+This function adds an element to @code{mmm-mode-ext-classes-alist},
+associating the submode class @var{class} with the major mode @var{mode}
+and extension @var{ext}.
+
+Older versions of MMM Mode required this function to be used to control
+the value of @code{mmm-mode-ext-classes-alist}, rather than setting it
+directly. In this version it is provided purely for convenience and
+backward compatibility.
address@hidden defun
+
+
address@hidden Insertion, Re-parsing, Selecting Classes, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Inserting new submode regions
+
+So much for noticing submode regions already present when you open a
+file. When editing a file with MMM Mode on, you will often want to add a
+new submode region. MMM Mode provides several facilities to help you.
+The simplest is to just hit a few keys and have the region and its
+delimiters inserted for you.
+
+Each submode class can define an association of keystrokes with
+``skeletons'' to insert a submode region. If there are several submode
+classes enabled in a buffer, it is conceivable that the keys they use
+for insertion might conflict, but unlikely as most buffers will not use
+more than one or two submode classes groups.
+
+As an example of how insertion works, consider the Mason classes. In a
+buffer with MMM Mode enabled and Mason associated, the key sequence
address@hidden % p} inserts the following perl section (the semicolon is to
+prevent CPerl Mode from getting address@hidden):
+
address@hidden
+<%perl>-<-;
+-!-
+->-</%perl>
address@hidden example
+
+In this schematic representation, the string @samp{-!-} represents the
+position of point (the cursor), @samp{-<-} represents the beginning of
+the submode region, and @samp{->-} its end.
+
+All insertion keys come after the MMM Mode prefix keys (by default
address@hidden %}; @pxref{Key Bindings}) and are by default single characters
+such as @kbd{p}, @kbd{%}, and @kbd{i}. To avoid confusion, all the MMM
+Mode commands are bound by default to control characters (after the same
+prefix keys), such as @kbd{C-b}, @kbd{C-%} and @kbd{C-r}. This is a
+change from earlier versions of MMM Mode, and can be customized; see
address@hidden Bindings}.
+
+To find out what insertion keys are available, consult the documentation
+for the submode class you are using. If it is one of the classes
+supplied with MMM Mode, you can find it in this Info file.
+
+Because insertion keys are implemented with a ``default binding'' for
+flexibility, they do not show up in the output of @kbd{C-h m} and cannot
+be found with @kbd{C-h k}. For this reason, MMM Mode supplies the
+command @kbd{C-c % h} (@code{mmm-insertion-help} to view the available
+insertion keys.
+
+
address@hidden Re-parsing, Interactive, Insertion, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Re-Parsing Submode Regions
address@hidden re-parsing submode regions
address@hidden parsing submode regions
address@hidden submode regions, re-parsing
address@hidden regions, submode, re-parsing
address@hidden submode regions, clearing
address@hidden clearing submode regions
address@hidden regions, submode, clearing
address@hidden C-c % C-b
address@hidden C-c % C-g
address@hidden C-c % C-%
address@hidden C-c % C-5
address@hidden C-c % C-k
+
+Describe @code{mmm-parse-buffer}, @code{mmm-parse-region},
address@hidden, and @code{mmm-clear-current-region}.
+
address@hidden Interactive, Global Mode, Re-parsing, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Interactive MMM-ification Functions
address@hidden interactive mmm-ification
address@hidden mmm-ification, interactive
address@hidden mmm-ification by region
address@hidden mmm-ification by regexp
address@hidden mmm-ification by class
address@hidden region, mmm-ification by
address@hidden regexp, mmm-ification by
address@hidden class, mmm-ification by
address@hidden C-c % C-r
address@hidden C-c % C-c
address@hidden C-c % C-x
address@hidden mmm-ification, interactive history
address@hidden history of interactive mmm-ification
address@hidden interactive mmm-ification, history of
+
+There are several commands you can use to create submode regions
+interactively, rather than by applying a submode class to a buffer. I
+find these commands (in particular, @code{mmm-ify-region}) to be most useful
+when I am editing a file or email message and want to include a snippet
+of code in some other language. For example, when I email someone a few
+lines of elisp code, I often put those lines in Emacs-Lisp mode to get
+the indentation nice and make sure the syntax is correct.
+
address@hidden @kbd
address@hidden C-c % C-r
+Creates a submode region between point and mark. Prompts for the submode
+to use, which must be a valid Emacs major mode name, such as
address@hidden or @code{cperl-mode}. Adds markers to the
+interactive history. (@code{mmm-ify-region})
+
address@hidden C-c % C-c
+Applies an already-defined submode class to the buffer, which it prompts
+for. Adds this class to the interactive history.
+(@code{mmm-ify-by-class})
+
address@hidden C-c % C-x
+Scans the buffer for submode regions (prompts for the submode) using
+front and back regular expressions that it also prompts for. Briefly, it
+starts at the beginning of the buffer and searches for the front regexp.
+If it finds a match, it searches for the back regexp. If it finds a
+match for that as well, it makes a submode region between the two
+matches and continues searching until no more matches are found. Adds
+the regexps to the interactive history. (@code{mmm-ify-by-regexp})
+
address@hidden table
+
+These commands are also useful when designing a new submode class
+(@pxref{Submode Classes}). Working with the regexps interactively can
+make it easier to debug and tune the class before starting to use it on
+automatic. All these commands also add to value of the following
+variable.
+
address@hidden mmm-interactive-history
+Stores a history of all interactive mmm-ification that has been
+performed in the current buffer. This way, for example, the re-parsing
+functions (@pxref{Re-parsing}) will respect interactively added regions,
+and the insertion keys for classes that were added interactively are
+available.
address@hidden defvar
+
+If for any reason you want to ``wipe the slate clean'', this command
+should help you. By default, it has no key binding, so you must invoke
+it with @kbd{M-x mmm-clear-history @key{RET}}.
+
address@hidden Command mmm-clear-history
+Clears all history of interactive mmm-ification in the current buffer.
+This command does not affect existing submode regions; to remove them,
+you may want to re-parse the buffer with @kbd{C-c % C-b}
+(@code{mmm-parse-buffer}).
address@hidden deffn
+
+
address@hidden Global Mode, Submode Faces, Interactive, Top
address@hidden  node-name,  next,  previous,  up
address@hidden MMM Global Mode
address@hidden mode, mmm global
address@hidden global mmm mode
address@hidden mmm global mode
address@hidden mmm-never-modes
+
+When a file has associated submode classes (@pxref{Selecting Classes}),
+you may want MMM Mode to turn itself on and parse that file for submode
+regions automatically whenever it is opened in an Emacs buffer. The
+value of the following variable controls when MMM Mode turns itself on
+automatically.
+
address@hidden mmm-global-mode
+Do not be misled by the fact that this variable's name ends in
address@hidden: it is not a simple on/off switch. There are three possible
+(meanings of) values for it: @code{t}, @code{nil}, and anything else.
+
+When this variable is @code{nil}, MMM Mode is never enabled
+automatically. If it is enabled manually, such as by typing @kbd{M-x
+mmm-mode}, any submode classes associated with the buffer will still be
+used, however.
+
+When this variable is @code{t}, MMM Mode is enabled automatically in
address@hidden buffers, including those not visiting files, except those
+whose major mode is an element of @code{mmm-never-modes}. The default
+value of this variable contains modes such as @code{help-mode} and
address@hidden in which most users would never want MMM Mode, and
+in which MMM might cause problems.
+
+When this variable is neither @code{nil} nor @code{t}, MMM Mode is
+enabled automatically in all buffers that would have associated submode
+classes; i.e. only if there would be something for it to do. The value
+of @code{mmm-never-modes} is still respected, however. Note that this
+can include buffers not visiting files, if that buffer's major mode is
+present in @code{mmm-mode-ext-classes-alist} with a @code{nil} value for
address@hidden (@pxref{Mode-Ext Classes}). Submode class values of @code{t}
+in @code{mmm-mode-ext-classes-alist} cause MMM Mode to be enabled in
+matching buffers, but supply no submode classes to be applied.
address@hidden defopt
+
address@hidden
+* Major Mode Hook::                                Using MMM's Major Mode Hook
address@hidden menu
+
+
address@hidden Major Mode Hook,  , Global Mode, Global Mode
address@hidden  node-name,  next,  previous,  up
address@hidden The Major Mode Hook
address@hidden hook, major mode
address@hidden major mode hook
address@hidden mmm-major-mode-hook
+
+This section is intended for users who understand Emacs Lisp and want to
+know how MMM Global Mode is implemented, and perhaps use the same
+technique. In fact, MMM Mode exports a hook variable that you can use
+easily, without understanding any of the details---see below.
+
+If we only wanted to enable MMM Mode in buffers visiting files, it would
+be sufficient to use @code{find-file-hooks}, which is run whenever a
+file is visited. Earlier version on MMM Mode did exactly this, and the
+current version also uses this hook; see below.
+
+In order to enable itself in @emph{all} buffers, however, MMM Mode has
+to hook itself into all major modes. It would be nice if there were a
+variable such as @code{major-mode-hook} that all major mode functions
+ran at the end, along with their specific hook. Unfortunately, such a
+variable does not exist (as of FSF Emacs 20.5), so we have to do some
+hacking.
+
+Global Font Lock Mode from the standard Emacs distribution (@pxref{Font
+Lock, , , emacs, The Emacs Manual}) has a similar problem, and solves it
+by adding a function to @code{change-major-mode-hook}, which is run by
address@hidden, which is run in turn by all major mode
+functions at the @emph{beginning}. This function stores a list of which
+buffers need fontification. It then adds a different function to
address@hidden, which checks if the current buffer needs
+fontification, and if so performs it. While this works, I think it is
+kind of kludgy.
+
+MMM Mode also adds a function to @code{change-major-mode-hook}, but what
+this function (@code{mmm-major-mode-change}) does is to look back
+through the call stack until it finds a mode function (recognizable
+because its name ends in @samp{-mode}) which is calling it, add
address@hidden to that function's name to get the conventional major mode
+hook name, then add a function to that hook. I think this is cleaner.
+
+In the interests of generality, and for your use, the function that MMM
+Mode adds to the major mode hooks (@code{mmm-run-major-mode-hook}) is
+not specific to MMM Mode, but rather runs the hook variable
address@hidden, which by default contains a function which
+possibly turns MMM Mode on, depending on the value of
address@hidden Thus, to run another function in all major
+modes, all you need to do is add it to this hook. For example, the
+following line in an initialization file will turn on Auto Fill Mode
+(@pxref{Auto Fill, , , emacs, The Emacs Manual}) in all buffers:
+
address@hidden
+(add-hook 'mmm-major-mode-hook 'turn-on-auto-fill)
address@hidden lisp
+
+Perhaps in some future version of Emacs, a major mode hook will become
+standard, but until then, we've got to live with hacks.
+
+
address@hidden Submode Faces, Mode Line, Global Mode, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Customizing Submode Faces
address@hidden faces, submode
address@hidden submode faces
address@hidden customizing submode faces
address@hidden default submode face
+
+[add stuff here]
+
+This can conflict with font-lock, if font-lock wants to use a background
+color. In such cases, the submode face takes precedence. If this bothers
+you, you can turn it off.
+
address@hidden Mode Line, Key Bindings, Submode Faces, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Customizing the Mode Line Display
+
+
address@hidden Key Bindings, Local Variables, Mode Line, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Customizing the MMM Mode Key Bindings
+
+
address@hidden Local Variables, Hooks, Key Bindings, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Changing Saved Local Variables
+
+
address@hidden Hooks, Mason, Local Variables, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Hooks Provided by MMM Mode
+
+
address@hidden Mason, Eval-Elisp, Hooks, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Mason: Perl in HTML
+
+FIXME: This is copied from the comments in @file{mmm-mason.el}.  Some
+more info would be nice.
+
+;; CPerl Workaround
+
+;; Note that CPerl mode tends to think it starts in the middle of an
+;; expression at the beginning of a submode region, and indents the
+;; first statement a couple extra columns. A workaround I've found is
+;; to begin all multiline Perl sections with an empty statement:
+
+;; <%perl>;
+;; print $var;
+;; </%perl>
+
+;; It isn't pretty, but it isn't ugly either, and it works better than
+;; anything else I can think of.
+
+;; PSGML Workaround
+
+;; Michael Alan Dorman has reported problems with psgml-mode and
+;; 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)
+
+;; Maybe these problems will be fixed in the future.
+
+;; autohandlers and dhandlers
+
+;; Another useful thing to do with Mason is putting autohandlers and
+;; dhandlers in html-mode (and thus, assuming mmm-mode-ext-classes is
+;; set up correctly, mmm-mode/mason). One way to do this is a line
+;; such as
+
+;; %# -*- mode: html; mmm-classes: mason -*-
+
+;; at the top of each such file. Another option is to a line like this
+;; to .emacs, which will put all files named "autohandler" or
+;; "dhandler" into html-mode:
+
+;; (add-to-list 'auto-mode-alist '("\\(auto\\|d\\)handler\\'" . html-mode))
+
+
address@hidden Eval-Elisp, HTML Here-documents, Mason, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Eval-Elisp: Elisp in a Local Variables List
+
+This submode class is not yet ported to the new syntax.
+
+
address@hidden HTML Here-documents, Javascript, Eval-Elisp, Top
address@hidden  node-name,  next,  previous,  up
address@hidden HTML in ``Here-documents''
+
+
address@hidden Javascript, Embedded CSS, HTML Here-documents, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Javascript in HTML
+
+
address@hidden Embedded CSS, HTML in PL/SQL, Javascript, Top
address@hidden  node-name,  next,  previous,  up
address@hidden CSS embedded in HTML
+
+
address@hidden HTML in PL/SQL, Concept Index, Embedded CSS, Top
address@hidden  node-name,  next,  previous,  up
address@hidden HTML in PL/SQL @code{htp.p} Methods
+
+This submode class is not yet ported to the new syntax.
+
+
address@hidden Concept Index, Function Index, HTML in PL/SQL, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Concept Index
+
address@hidden cp
+
+
address@hidden Function Index, Keystroke Index, Concept Index, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Function and Variable Index
+
address@hidden fn
+
+
address@hidden Keystroke Index,  , Function Index, Top
address@hidden  node-name,  next,  previous,  up
address@hidden Keystroke Index
+
address@hidden ky
+
+
address@hidden
+
address@hidden etc...
+
address@hidden Local Variables:
address@hidden mode: texinfo
address@hidden mode: font-lock
address@hidden mode: outline-minor
address@hidden End:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]