Skip to content

Commit

Permalink
Merge pull request #140 from snogge/docs-installation-home
Browse files Browse the repository at this point in the history
Update the installation instructions in the manual, and some small stuff
  • Loading branch information
dgutov authored Feb 22, 2024
2 parents fec2640 + 3801389 commit 9e7e67a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 33 deletions.
2 changes: 1 addition & 1 deletion FAQ
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ have with it, so they can be fixed for the next release.

* You haven't answered my question; how can I get more help?

Create an issue at <https://github.com/purcell/mmm-mode/issues>, or
Create an issue at <https://github.com/dgutov/mmm-mode/issues>, or
check out the MMM Mode web site, <http://mmm-mode.sourceforge.net>,
there is a link to the subscription page for the MMM Mode mailing list.

Expand Down
2 changes: 1 addition & 1 deletion mmm-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; Package: mmm-mode
;; Author: Michael Abraham Shulman <[email protected]>
;; Maintainer: Dmitry Gutov <[email protected]>
;; URL: https://github.com/purcell/mmm-mode
;; URL: https://github.com/dgutov/mmm-mode
;; Keywords: convenience, faces, languages, tools
;; Version: 0.5.10
;; Package-Requires: ((emacs "25.1") (cl-lib "0.2"))
Expand Down
4 changes: 2 additions & 2 deletions mmm-myghty.el
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Saves the name of the tag matched.")

(defvar mmm-myghty-tag-names-regexp
(regexp-opt (append mmm-myghty-python-tags mmm-myghty-non-python-tags) t)
"Matches any Myghty tag name after the \"<%\". Used to verify that a
\"<%\" sequence starts an inline section.")
"Matches any Myghty tag name after the \"<%\".
Used to verify that a \"<%\" sequence starts an inline section.")

(defun mmm-myghty-verify-inline ()
(not (looking-at mmm-myghty-tag-names-regexp)))
Expand Down
2 changes: 1 addition & 1 deletion mmm-noweb.el
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ This is set to FUNDAMENTAL-MODE by default, but you might want to change
this in the Local Variables section of your file to something more
appropriate, like C-MODE, FORTRAN-MODE, or even INDENTED-TEXT-MODE."
;; FIXME: Any of CC Mode modes aren't really appropriate:
;; https://github.com/purcell/mmm-mode/issues/57
;; https://github.com/dgutov/mmm-mode/issues/57
)

(defvar mmm-noweb-quote-mode nil
Expand Down
12 changes: 6 additions & 6 deletions mmm-rpm.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

;; This file contains the definition of an MMM Mode submode class for
;; editing shell script sections within RPM (Redhat Package Manager)
;; spec files. I recommend to use it in combination with
;; spec files. I recommend to use it in combination with
;; rpm-spec-mode.el by Stig Bjørlykke <[email protected]> and Steve
;; Sanbeg <[email protected]> (http://www.xemacs.org/~stigb/rpm-spec-mode.el)
;; Sanbeg <[email protected]> (https://github.com/stigbjorlykke/rpm-spec-mode)

;;; Installation:

Expand All @@ -47,19 +47,19 @@
(defconst mmm-rpm-sh-start-tags
'("prep" "build" "install" "clean" "preun" "postun" "pre"
"post" "triggerin" "triggerun" "triggerpostun")
"List containing RPM tags that start a shell-script section in a spec file")
"List containing RPM tags that start a shell-script section in a spec file.")

(defvar mmm-rpm-sh-end-tags
(append '("files" "description" "package") mmm-rpm-sh-start-tags)
"List containing RPM tags that end a shell-script section in a spec file")
"List containing RPM tags that end a shell-script section in a spec file.")

(defvar mmm-rpm-sh-start-regexp
(concat "^%" (mmm-regexp-opt mmm-rpm-sh-start-tags t) "\\b.*$")
"Regexp matching RPM tags that start a shell-script section in a spec file")
"Regexp matching RPM tags that start a shell-script section in a spec file.")

(defvar mmm-rpm-sh-end-regexp
(concat "\\'\\|^%" (mmm-regexp-opt mmm-rpm-sh-end-tags t) "\\b.*$")
"Regexp matching RPM tags that end a shell-script section in a spec file")
"Regexp matching RPM tags that end a shell-script section in a spec file.")

(mmm-add-group
'rpm
Expand Down
52 changes: 30 additions & 22 deletions mmm.texi
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ contain sample code. And so on. We encourage you to experiment.
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,
automatically with @code{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:
Expand Down Expand Up @@ -273,7 +273,8 @@ The submode regions are highlighted by a background color; see
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
@code{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.
@xref{Overlays, , , elisp, The GNU Emacs Lisp Reference Manual}, for
more information on overlays.
Expand All @@ -290,25 +291,31 @@ buffer's file extension, dominant mode, or local variables.
@node Installation
@section 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,
@command{cd} 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.
The recommended way to install MMM Mode is from GNU ELPA.

Now you need to configure your Emacs initialization file (usually
@file{~/.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
@code{load-path}. This can be done in the parent directory's
@file{subdirs.el} file, or in the init file with a line such as:
@lisp
(package-install 'mmm-mode)
@end lisp

@noindent
You can also add the MMM Mode directory to your @code{load-path}.

@lisp
(add-to-list 'load-path "/path/to/mmm-mode/")
@end lisp

@noindent
The Makefile distributed with MMM Mode can be used to byte compile the
code and build the Info documentation with a simple @code{make}
command. Don't forget to add the MMM mode directory to your
@code{Info-directory-list}.

@lisp
(add-to-list 'load-path "/path/to/site-lisp/mmm/")
(add-to-list 'Info-directory-list pkg-dir)
@end lisp

Once @code{load-path} is configured, MMM Mode must be loaded. You can
Once the package is installed or @code{load-path} configured, MMM Mode
must be loaded. You can
load all of MMM Mode with the line

@lisp
Expand Down Expand Up @@ -361,7 +368,7 @@ 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.
comments on that mode. Then come back here to find out how 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.
Expand All @@ -371,6 +378,7 @@ 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
@samp{-*- mmm-classes: @var{class} -*-} at the top of the file.
@var{class} can also be a list of submode classes.
@xref{File 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
Expand Down Expand Up @@ -423,10 +431,10 @@ This chapter explains the most important parts of how to use MMM 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}).
@code{mmm-mode} which manages the submode regions. @code{mmm-mode}
must be turned on in a buffer for submode regions to be
effective. When activated, @code{mmm-mode} is denoted by @samp{MMM} in
the mode line (@pxref{Mode Line}).

@menu
* Enabling MMM Mode:: Turning MMM Mode on and off.
Expand All @@ -446,7 +454,7 @@ Line}).
@cindex disabling mmm mode

If @code{mmm-global-mode} is non-@code{nil} (@pxref{Global Mode}),
then the MMM minor mode will be turned on automatically whenever a file
@code{mmm-mode} will be enabled 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
Expand Down

0 comments on commit 9e7e67a

Please sign in to comment.