emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master 5f276a1 307/433: Update instructions and docstrings


From: Dmitry Gutov
Subject: [elpa] master 5f276a1 307/433: Update instructions and docstrings
Date: Thu, 15 Mar 2018 19:44:25 -0400 (EDT)

branch: master
commit 5f276a1c2ba35218c29d7c71f4dcac5fc9e9f1b1
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Update instructions and docstrings
---
 mmm-erb.el | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/mmm-erb.el b/mmm-erb.el
index 0ad42f9..d59a849 100644
--- a/mmm-erb.el
+++ b/mmm-erb.el
@@ -25,20 +25,28 @@
 
 ;;; Commentary:
 
-;; This file contains the definition of JavaScript, CSS, ERB and EJS submode
+;; This file contains definitions 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)
+
+;; (setq mmm-global-mode 'auto)
+
+;; (mmm-add-mode-ext-class 'html-erb-mode nil 'html-js)
+;; (mmm-add-mode-ext-class 'html-erb-mode nil '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))
 
+;; Optional settings:
+
+;; (setq mmm-submode-decoration-level 2
+;;       mmm-parse-when-idle t)
+
 ;;; Code:
 
 (require 'sgml-mode)
@@ -103,11 +111,11 @@
   (add-hook 'mmm-js-mode-submode-hook 'mmm-erb-process-submode nil t))
 
 (defun mmm-erb-process-submode ()
-  "Hook function run when entering erb submode."
+  "Hook function to run after primary or submode major mode function."
   (setq indent-line-function 'mmm-erb-indent-line))
 
 (defun mmm-erb-indent-line ()
-  "Indent current line or selection intelligently."
+  "Indent the current line intelligently."
   (interactive)
   (let ((offset (- (current-column) (current-indentation))))
     (back-to-indentation)
@@ -158,6 +166,7 @@
           (or additional-offset 0))))))
 
 (defun mmm-erb-indent-line-primary ()
+  "Indent line in primary mode."
   (let* ((here (point))
          ;; Go before previous line's tag.
          (start (progn (forward-line -1)
@@ -202,8 +211,8 @@
             (skip-syntax-forward "-")
             (funcall scan-fn end)))))))
 
-(defconst mmm-erb-ruby-close-re "\\bend\\b\\|}"
-  "Regexp to match the end of an Ruby block.")
+(defconst mmm-erb-ruby-close-re "\\<end\\>\\|}"
+  "Regexp to match the end of a Ruby block.")
 
 (defun mmm-erb-scan-erb (limit)
   (cond ((looking-at "\\(?:if\\|unless\\|for\\|while\\)\\b") 'open)
@@ -233,4 +242,5 @@
     (when name (symbol-value name))))
 
 (provide 'mmm-erb)
+
 ;;; mmm-erb.el ends here



reply via email to

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