Initial Commit
[packages] / xemacs-packages / mmm-mode / FAQ
1 -*-outline-*-
2               Frequently Asked Questions about MMM Mode
3               =========================================
4
5 * How do I write/capitalize the name of this package/mode?
6
7 However you want.  The author says `MMM Mode' (and occasionally `MMM')
8 when discussing the entire package, and `mmm-mode' when discussing the
9 emacs mode or function.  He does think, however, that `Mmm' looks
10 rather ugly, although that is how SourceForge insists on capitalizing
11 the name of the mailing list.
12
13
14 * How do I get rid of that ugly gray background color?
15
16 Put the following line in your Emacs initialization file:
17
18   (setq mmm-submode-decoration-level 0)
19
20 You may want to try using MMM Mode for a while with the background
21 highlight, however, or merely changing it to a different color.  There
22 are two reasons it's there by default:
23
24 1. MMM Mode isn't as smart as you might hope it would be about
25    recognizing new submode regions, so the presence or absence of the
26    highlight can let you know at a glance where it thinks they are.
27
28 2. Just like the rest of font-lock, it helps you mentally organize the
29    code; you can see at a glance that THIS code is executed as Perl,
30    but THAT code is straight HTML (or whatever).  You can get even
31    more help by setting the above variable to 2, in which case regions
32    will get a background color according to their function.
33
34
35 * I typed `<%' (or other delimiter) but I'm still in the wrong mode.
36
37 MMM Mode isn't that smart yet.  You have to tell it explicitly to
38 reparse (`C-c % C-5' or `C-c % C-b') when you add new submode regions,
39 and both delimiters have to be present.  Hopefully a future version
40 will be able to automatically recognize new regions an you type them,
41 but that version is not yet here.
42
43 However, most submode classes provide insertion commands that remove
44 the need to type the delimiters as well as the need to reparse the
45 block: type `C-c % h' for a list of available insertion commands for
46 current submode class(es).
47
48
49 * Why is the first character of the end delimiter in the submode region?
50
51 It isn't.  When your cursor looks like it is over that character, it
52 is actually *before* that character and therefore inside the submode
53 region.  You can check that the offending character does not have the
54 background highlight--that is, if you haven't set the decoration level
55 to 0.  For example, in the following text (where -!- represents the
56 cursor position)
57
58   print <<END_TEXT;
59   here is some text
60   -!-END_TEXT
61
62 The 'E' at the beginning of the END_TEXT line is not actually part of
63 the submode region.  But with the cursor as indicated (that is, the
64 box is blinking over the `E' which follows the actual cursor
65 position), Emacs is in text-mode.
66
67
68 * Why won't MMM Mode work with `foo-mode'?
69
70 Foo-mode probably has extra variables or states that need to be set
71 up, that MMM Mode doesn't yet know about.  Often this sort of problem
72 can be fixed by adding elements to `mmm-save-local-variables'.  If you
73 know some Elisp, you may want to try and track down the problem
74 yourself, or you can contact the mailing list and ask for help.
75 Either way, please contact the maintainer or the mailing list when
76 (if) you find something that works, so that in the future, folks can
77 use MMM Mode and foo-mode together more easily.
78
79
80 * I'm getting an emacs error, what did I do wrong?
81
82 Most likely nothing.  MMM Mode is still more or less alpha software
83 and is quite likely to contain bugs; probably something in your
84 configuration has brought a new bug to light.  Please send the text of
85 the error, along with a stack backtrace (1) and the relevant portions
86 of your emacs initialization file, to either the maintainer or the
87 mailing list, and hopefully a fix can be worked out.
88
89 Of course, it's also possible that there is an error in your
90 configuration.  Double-check the elisp syntax in your init file, or
91 inspect the backtrace yourself.  If the error happens while loading
92 your init code, try manually evaluating it line by line (`C-x C-e') to
93 see where the error occurs.  Folks on the mailing list can also help
94 point out errors, but only with your init code and a backtrace.
95
96 (1) To get a stack backtrace of an error, set the emacs variable
97     `debug-on-error' to non-nil (type `M-x set-variable RET
98     debug-on-error RET t RET' or `M-: (setq debug-on-error t) RET'),
99     then repeat the actions which caused the error.  A stack backtrace
100     should pop up which you can select and copy.  If the error occurs
101     while loading emacs, invoke emacs with the `--debug-init' (Emacs)
102     or `-debug-init' (XEmacs) switch.
103
104
105 * Will MMM Mode work with (Emacs 19 / XEmacs 20 / XEmacs 21 / etc...)?
106
107 MMM Mode was designed for FSF Emacs 20 and 21 and works best there.
108 But don't let that stop you from trying it under other variants of
109 emacs.  If you encounter problems, feel free to ask the mailing list,
110 but success is not guaranteed.
111
112 For example, the font-lock support in XEmacs 20 is known to be broken
113 and well-nigh unfixable; consider upgrading.  XEmacs 21 also has
114 problems with font-lock: for example, often apostrophes in a different
115 submode region can cause code to be incorrectly font-locked as a
116 string.  I have given up trying to support Emacs 19; you should
117 upgrade to Emacs 20 or 21.
118
119
120 * XEmacs says `Symbol's function definition is void: make-indirect-buffer'.
121
122 You probably used FSF Emacs to compile MMM as it is the one used by
123 default if both are installed.  To explicitly set the emacs to use
124 when byte compiling, do the following:
125
126 $ cd mmm-mode-x.x.x
127 $ make distclean
128 $ ./configure --with-xemacs=/path/to/xemacs
129 $ make
130 $ make install
131
132 Running `make distclean' is only necessary if you have already
133 compiled MMM Mode for the wrong emacs, but can never hurt.  The exact
134 error message this problem produces may change with newer versions of
135 MMM Mode; always be sure you have compiled for the correct emacsen.
136
137
138 * I want to install the CVS version, but there's no `configure' script.
139
140 The `configure' script which is included in the official distributions
141 is not present in CVS, because it is automatically generated by GNU
142 Automake/Autoconf from files like `Makefile.am' and `configure.in'.
143 To build the CVS version the same way as the official distributions,
144 you must first run `autogen.sh':
145
146 $ cd mmm-mode
147 $ ./autogen.sh
148
149 and then you can continue as usual:
150
151 $ ./configure
152 $ make
153 $ make install
154
155 Note that autogen.sh requires aclocal, automake, and autoconf, which
156 may or may not be installed on your system, since they are considered
157 developer tools rather than end-user tools.  If you can't or don't
158 want to install them, however, you can still use the CVS version of
159 MMM Mode by manually copying all the `.el' files into a directory in
160 your `load-path'.  Optionally, you may also byte-compile them manually
161 (this is what `make' normally does).  Byte-compiling gives some speed
162 improvement, but if you experience problems, the stack traces are
163 sometimes more informative if you are using the source files only.
164
165 The Info files `mmm.info-*' are also not included in CVS, since they
166 are generated from `mmm.texinfo' by the program `makeinfo'.  If you
167 want to install the Info documentation from CVS, you will have to run
168 this manually as well, and copy the resulting info files into the
169 appropriate location for your system.
170
171 The CVS version is, of course, even less guaranteed to be bug-free
172 than the official distributions.  But please report any problems you
173 have with it, so they can be fixed for the next release.
174
175
176 * You haven't answered my question; how can I get more help?
177
178 At the MMM Mode web site, <http://mmm-mode.sourceforge.net>, there is
179 a link to the subscription page for the MMM Mode mailing list.  When
180 asking a question on the list, be sure to give the versions of emacs
181 and MMM Mode you are using, and any other relevant information.