[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2ca7e6a 300/433: Add header comment, provide description
From: |
Dmitry Gutov |
Subject: |
[elpa] master 2ca7e6a 300/433: Add header comment, provide description |
Date: |
Thu, 15 Mar 2018 19:44:24 -0400 (EDT) |
branch: master
commit 2ca7e6a740b4ab81fe643b55a74bdd5b24ecc33f
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Add header comment, provide description
---
mmm-erb.el | 57 +++++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 49 insertions(+), 8 deletions(-)
diff --git a/mmm-erb.el b/mmm-erb.el
index dc366d3..2a06315 100644
--- a/mmm-erb.el
+++ b/mmm-erb.el
@@ -1,3 +1,50 @@
+;;; mmm-erb.el --- ERB templates editing support
+
+;; Copyright (C) 2012 by Dmitry Gutov
+
+;; Author: Dmitry Gutov <address@hidden>
+
+;;{{{ GPL
+
+;; This file 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 file 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 GNU Emacs; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;}}}
+
+;;; Commentary:
+
+;; This file contains the definition of JavaScript, CSS, ERB and EJS submode
+;; classes, and well as support functions for proper indentation.
+
+;; Usage:
+
+;; (require 'mmm-auto)
+;; (mmm-add-mode-ext-class 'html-erb-mode "\\.html\\(\\.erb\\)?\\'" 'html-js)
+;; (mmm-add-mode-ext-class 'html-erb-mode "\\.html\\(\\.erb\\)?\\'" 'html-css)
+;; (mmm-add-mode-ext-class 'html-erb-mode "\\.html\\.erb\\'" 'erb)
+;; (mmm-add-mode-ext-class 'html-erb-mode "\\.jst\\.ejs\\'" 'ejs)
+
+;; (add-to-list 'auto-mode-alist '("\\.html\\.erb\\'" . html-erb-mode))
+;; (add-to-list 'auto-mode-alist '("\\.jst\\.ejs\\'" . html-erb-mode))
+
+;;; Code:
+
+(require 'sgml-mode)
+(eval-when-compile (require 'cl))
+(require 'mmm-vars)
+
(mmm-add-group
'html-js
'((js-script-cdata
@@ -46,11 +93,6 @@
(pushnew '(indent-line-function buffer) mmm-save-local-variables)
-(mmm-add-mode-ext-class 'html-erb-mode "\\.html\\(\\.erb\\)?\\'" 'html-js)
-(mmm-add-mode-ext-class 'html-erb-mode "\\.html\\(\\.erb\\)?\\'" 'html-css)
-(mmm-add-mode-ext-class 'html-erb-mode "\\.html\\.erb\\'" 'erb)
-(mmm-add-mode-ext-class 'html-erb-mode "\\.jst\\.ejs\\'" 'ejs)
-
;;;###autoload
(define-derived-mode html-erb-mode html-mode "ERB-HTML"
(setq sgml-unclosed-tags nil) ; Simplifies indentation logic.
@@ -131,9 +173,8 @@
(when (plusp n) (decf n))
(incf n (if (eq type 'close) 0 1))))
(let ((eol (progn (goto-char here) (end-of-line 1) (point))))
- ;; There can be primary mode regions in the list, so we loop.
- ;; Look for "else" and "end" instructions.
- ;; If a block start instruction comes first, don't adjust modifier.
+ ;; Look for "else" and "end" instructions to adjust modifier.
+ ;; If a block start instruction comes first, abort.
(loop for region in (mmm-regions-in here eol)
for type = (mmm-erb-scan-region region)
until (eq type 'open)
- [elpa] master 0da2ac9 358/433: * mmm-syntax-propertize-function: Don't pass nil to mmm-set-local-variables, (continued)
- [elpa] master 0da2ac9 358/433: * mmm-syntax-propertize-function: Don't pass nil to mmm-set-local-variables, Dmitry Gutov, 2018/03/15
- [elpa] master e414b5b 314/433: Fix #12, Dmitry Gutov, 2018/03/15
- [elpa] master 631e7f1 408/433: Add c-symbol-char-key to the saved variables, Dmitry Gutov, 2018/03/15
- [elpa] master c493716 404/433: Revert "mmm-match-region: Return front-pos even without front-delim; likewise for back", Dmitry Gutov, 2018/03/15
- [elpa] master d2c8ade 428/433: More text, Dmitry Gutov, 2018/03/15
- [elpa] master 7661968 415/433: Merge pull request #74 from AdamNiederer/master, Dmitry Gutov, 2018/03/15
- [elpa] master 6812418 424/433: Add a FIXME, Dmitry Gutov, 2018/03/15
- [elpa] master 93cd2cf 412/433: Add function for narrowed indentation, Dmitry Gutov, 2018/03/15
- [elpa] master 16d937d 019/433: Added files required by automake., Dmitry Gutov, 2018/03/15
- [elpa] master 8e205dd 400/433: Don't use version.texi at all, Dmitry Gutov, 2018/03/15
- [elpa] master 2ca7e6a 300/433: Add header comment, provide description,
Dmitry Gutov <=
- [elpa] master 956354f 375/433: Fix missing var declaration, Dmitry Gutov, 2018/03/15
- [elpa] master fff25f6 311/433: Note that 'autogen.sh' should be run to generate 'configure' and 'Makefile.in' (see #11), Dmitry Gutov, 2018/03/15
- [elpa] master 3fb2964 416/433: Update Michael's email address to an active one, Dmitry Gutov, 2018/03/15
- [elpa] master 6c5d442 425/433: Fix copyright entry, Dmitry Gutov, 2018/03/15
- [elpa] master e848ef1 323/433: * mmm-fontify-region: Save and restore submode, overlay and local vars, Dmitry Gutov, 2018/03/15
- [elpa] master 004a618 370/433: Fix #23, Dmitry Gutov, 2018/03/15
- [elpa] master 53524db 389/433: Remove version.texi from the repo, Dmitry Gutov, 2018/03/15
- [elpa] master 2c9532b 326/433: Simplify mmm-update-mode-info, Dmitry Gutov, 2018/03/15
- [elpa] master e767fa2 265/433: Added script and documentation for installing from CVS, Dmitry Gutov, 2018/03/15
- [elpa] master 7965887 279/433: Fix error in mmm-mode when Emacs 23 immediately evaporates zero-width submode regions, Dmitry Gutov, 2018/03/15