-
Notifications
You must be signed in to change notification settings - Fork 32
/
README
87 lines (59 loc) · 3.02 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
MMM Mode for Emacs
==================
OVERVIEW
MMM Mode is a minor mode for Emacs that allows Multiple Major Modes
to coexist in one buffer. It is well-suited to editing:
* Preprocessed code, such as server-side Ruby, Perl or PHP embedded in HTML
* Code generating code, such as HTML output by CGI scripts
* Embedded code, such as Javascript in HTML
* Literate programming: code interspersed with documentation, e.g. Noweb
INSTALLATION
Use any of the following options:
1. Users of package.el (a.k.a. ELPA) can easily install MMM Mode from
the ELPA package repository at https://elpa.gnu.org/ -- this is the
preferred and best-supported installation mechanism.
2. 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 Makefile has a target to build the MMM Mode info manual, so if
you're installing manually you might want to do that too. Put the mmm.info
file somewhere on your Info-path and use install-info to generate or update
the dir file.
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;
usually the latter is preferable, except possibly for autoloads.
First the package needs to be loaded, with either
(require 'mmm-mode)
or instead, to save time during emacs startup,
(require 'mmm-auto)
Then you will probably want to set something like this:
(setq mmm-global-mode 'maybe)
(mmm-add-mode-ext-class 'html-mode "\\.php\\'" 'html-php)
The first line tells MMM Mode to load itself whenever you open an
appropriate file, and the second is an example which says to notice
PHP regions in html-mode files having a `.php' extension. Both
lines are necessary.
You will, of course, want to change and duplicate the second line
according to your needs. either of the first two parameters can be
`nil', meaning not to consider that criterion. For example, if all
your html files, regardless of extension, are Mason components, you
will want something like:
(mmm-add-mode-ext-class 'html-mode nil 'mason)
whereas if all your files with a `.nw' extension, regardless of
primary mode (some may be LaTeX, others HTML, say) are Noweb, you
will prefer
(mmm-add-mode-ext-class nil "\\.nw\\'" 'noweb)
See the info file for more extensive documentation, and for other
configuration options.
DOCUMENTATION
For further information, see (in order) the accompanying info file,
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
https://github.com/purcell/mmm-mode
FEEDBACK
Bug reports, suggestions and questions can be submitted at
https://github.com/purcell/mmm-mode/issues.
Thanks for using MMM Mode!