summary refs log tree commit diff stats
path: root/tag-emacs/emacs.d/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'tag-emacs/emacs.d/init.el')
-rw-r--r--tag-emacs/emacs.d/init.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index 35d63f9b..fab42b21 100644
--- a/tag-emacs/emacs.d/init.el
+++ b/tag-emacs/emacs.d/init.el
@@ -1063,6 +1063,24 @@
                 web-mode-comment-style 2
                 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))))
+  :init (setq 'mmm-global-mode 'maybe))
+
 ;;;; Windows & Frames
 
 (setq frame-title-format