From 3e15bd32d236180ba5fa5ce5da083d538791a608 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 10 Jul 2014 22:05:45 +0100 Subject: Emacs: Add mmm-mode for SQL inside PHP …assuming I got the regex right. --- tag-emacs/emacs.d/Cask | 1 + tag-emacs/emacs.d/init.el | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) (limited to 'tag-emacs') diff --git a/tag-emacs/emacs.d/Cask b/tag-emacs/emacs.d/Cask index 78b286c2..f3a1dc9b 100644 --- a/tag-emacs/emacs.d/Cask +++ b/tag-emacs/emacs.d/Cask @@ -45,6 +45,7 @@ (depends-on "lua-mode") (depends-on "magit") (depends-on "markdown-mode") +(depends-on "mmm-mode") (depends-on "move-text") (depends-on "multi-term") (depends-on "multiple-cursors") 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-*[\"']\\|<<