[Top][All Lists]

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

[elpa] master cbbb3cc 162/433: Added comments on RPM Spec, File Variable

From: Dmitry Gutov
Subject: [elpa] master cbbb3cc 162/433: Added comments on RPM Spec, File Variables, and Here-documents.
Date: Thu, 15 Mar 2018 19:43:55 -0400 (EDT)

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

    Added comments on RPM Spec, File Variables, and Here-documents.
 mmm.texinfo | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 65 insertions(+), 5 deletions(-)

diff --git a/mmm.texinfo b/mmm.texinfo
index 3e7cba5..89fc469 100644
--- a/mmm.texinfo
+++ b/mmm.texinfo
@@ -107,7 +107,7 @@ Customizing MMM Mode
 Supplied Submode Classes
 * Mason::                       Mason syntax for server-side Perl in HTML.
-* Eval-Elisp::                  Emacs Lisp in @code{eval} file variables.
+* File Variables::              Elisp code in File Variables.
 * Here-documents::              Code in shell and Perl here-documents.
 * Javascript::                  Javascript embedded in HTML.
 * Embedded CSS::                CSS Styles embedded in HTML.
@@ -1140,7 +1140,7 @@ delimiter.
address@hidden Mason, Eval-Elisp, Writing Classes, Top
address@hidden Mason, File Variables, Writing Classes, Top
 @comment  node-name,  next,  previous,  up
 @chapter Mason: Perl in HTML
@@ -1222,15 +1222,58 @@ This tells PSGML that the current file is a 
sub-document of the file
 alleviating its confusion.
address@hidden Eval-Elisp, Here-documents, Mason, Top
address@hidden File Variables, Here-documents, Mason, Top
 @comment  node-name,  next,  previous,  up
address@hidden Eval-Elisp: Elisp in a Local Variables List
address@hidden Elisp in a Local Variables List
+Emacs allows the author of a file to specify major and minor modes to be
+used while editing that file, as well as specifying values for other
+local Elisp variables, with a File Variables list.  @xref{File
+Variables, , , emacs, The Emacs Manual}.  Since file variables values
+are Elisp objects (and with the @code{eval} special ``variable'', they
+are forms to be evaluated), one might want to edit them in
address@hidden  The submode class @code{file-variables} allows
+this, and is suitable for turning on in a given file with
address@hidden, or in all files with @code{mmm-global-classes}.
address@hidden Here-documents, Javascript, Eval-Elisp, Top
address@hidden Here-documents, Javascript, File Variables, Top
 @comment  node-name,  next,  previous,  up
 @chapter Here-documents
+One of the long-time standard syntaxes for outputting large amounts of
+code (or text, or HTML, or whatever) from a script (notably shell
+scripts and Perl scripts) is the here-document syntax:
+print <<END_HTML;
+  <head>
+    <title>Test Page</title>
+  </head>
+  <body>
address@hidden example
+The @code{here-doc} submode class recognizes this syntax, and can even
+guess the correct submode to use in many cases.  For instance, it would
+put the above example in @code{html-mode}, noticing the string
address@hidden in the name of the here-document.  If you use less than
+evocative here-document names, or if the submode is recognized
+incorrectly for any other reason, you can tell it explicitly what
+submode to use.
address@hidden mmm-here-doc-mode-alist
+The value of this variable should be an alist, each element a cons pair
+associating a regular expression to a submode symbol.  Whenever a
+here-document name matches one of these regexps, the corresponding
+submode is applied.  For example, if this variable contains the element
address@hidden("CODE" . cc-mode)}, then any here-document whose name contains
+the string @samp{CODE} will be put in @code{cc-mode}.  The value of this
+variable overrides any guessing that the @code{here-doc} submode class
+would do otherwise.
address@hidden defopt
 @node Javascript, Embedded CSS, Here-documents, Top
 @comment  node-name,  next,  previous,  up
@@ -1251,6 +1294,23 @@ alleviating its confusion.
 @comment  node-name,  next,  previous,  up
 @chapter RPM Spec Files
address@hidden contains the definition of an MMM Mode submode class
+for editing shell script sections within RPM (Redhat Package Manager)
+spec files.  It is recommended for use in combination with
address@hidden by Stig Bj�rlykke <stigb@@tihlde.hist.no> and
+Steve Sanbeg <sanbeg@@dset.com>
+Suggested setup code:
+(add-to-list 'mmm-mode-ext-classes-alist
+             '(rpm-spec-mode "\\.spec\\'" rpm-sh))
address@hidden lisp
+Thanks to Marcus Harnisch <Marcus.Harnisch@@gmx.net> for contributing
+this submode class.
 @node Concept Index, Function Index, RPM, Top
 @comment  node-name,  next,  previous,  up

reply via email to

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