summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2014-07-12 22:49:18 +0100
committerAlan Pearce2014-07-12 22:51:24 +0100
commite9200d1baa6a6c86503028c7d15696f6dddf45b7 (patch)
tree87766b57fee662758545c025d44e147214e760dd
parent1ddedd165d9342866f7592a4d46fa8c3c48c150c (diff)
downloaddotfiles-e9200d1baa6a6c86503028c7d15696f6dddf45b7.tar.lz
dotfiles-e9200d1baa6a6c86503028c7d15696f6dddf45b7.tar.zst
dotfiles-e9200d1baa6a6c86503028c7d15696f6dddf45b7.zip
Emacs: Simplify PHP-SQL MMM configuration
-rw-r--r--tag-emacs/emacs.d/init.el21
1 files changed, 7 insertions, 14 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index bc131f5..8fd1b20 100644
--- a/tag-emacs/emacs.d/init.el
+++ b/tag-emacs/emacs.d/init.el
@@ -1097,20 +1097,13 @@
 
 (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