all repos — archive/dotfiles @ e9200d1baa6a6c86503028c7d15696f6dddf45b7

Superseded by nixfiles

Emacs: Simplify PHP-SQL MMM configuration
Alan Pearce alan@alanpearce.co.uk
Sat, 12 Jul 2014 22:49:18 +0100
commit

e9200d1baa6a6c86503028c7d15696f6dddf45b7

parent

1ddedd165d9342866f7592a4d46fa8c3c48c150c

1 files changed, 7 insertions(+), 14 deletions(-)

jump to
M tag-emacs/emacs.d/init.eltag-emacs/emacs.d/init.el
@@ -1097,20 +1097,13 @@ web-mode-disable-auto-pairing t)) 
 (req-package mmm-auto
   :config (progn
-            (defvar php-sql-mmm-submode-enabled nil)
-            (defun php-sql-mmm-submode ()
-              "Provides a very minimal embedding of SQL in PHP, via mmm-mode."
-              (interactive)
-              (when (not php-sql-mmm-submode-enabled)
-                (set-face-background 'mmm-default-submode-face nil)
-                (mmm-add-classes
-                 '((php-sql
-                    :submode sql-mode
-                    :front "\\($\\(sql\\|query\\)\\s-*=\\s-*[\"']\\|<<<SQL\\)"
-                    :back "\\([\"']\\|SQL\\);?"
-                    :face mmm-code-submode-face)))
-                (mmm-add-mode-ext-class 'php-mode "\\.php$" 'php-sql)
-                (setq php-sql-mmm-submode-enabled t)))
+            (mmm-add-classes
+             '((php-sql
+                :submode sql-mode
+                :front "\\($\\(sql\\|query\\)\\s-*=\\s-*[\"']\\|<<<SQL\\)[\r\n]+"
+                :back "\\([\"']\\|SQL\\);?"
+                :face mmm-code-submode-face)))
+            (mmm-add-mode-ext-class 'php-mode "\\.php$" 'php-sql)
             (mmm-add-classes
              '((markdown-toml
                 :submode toml-mode