Improve mmm-mode

This commit is contained in:
Jesús 2018-11-10 20:18:07 -05:00
parent a4607a27d3
commit a097edaebc
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -1,16 +1,29 @@
(use-package mmm-mode (use-package mmm-mode
:config :config
(setq mmm-global-mode 'maybe) (setq mmm-global-mode 'maybe)
(mmm-add-mode-ext-class nil "\\.php?\\'" 'html-php) (mmm-add-mode-ext-class nil "\\.php?\\'" 'html-php)
(mmm-add-mode-ext-class nil "\\.ctp?\\'" 'html-php) (mmm-add-mode-ext-class nil "\\.ctp?\\'" 'html-php)
(set-face-background 'mmm-default-submode-face nil) (set-face-background 'mmm-default-submode-face nil)
(mmm-add-classes
'((html-php (mmm-add-group 'html-php
:submode php-mode '((html-php-output
:front "<\\?\\(php\\)?" :submode php-mode
:back "\\?>"))) :face mmm-output-submode-face
:front "<\\?php *echo "
:back "\\(\\?>\\|\\'\\)"
:include-front t
:front-offset 5
:insert ((?e php-echo nil @ "<?php" @ " echo " _ " " @ "?>" @))
)
(html-php-code
:submode php-mode
:face mmm-code-submode-face
:front "<\\?\\(php\\)?"
:back "\\(\\?>\\|\\'\\)"
:insert ((?p php-section nil @ "<?php" @ " " _ " " @ "?>" @)
(?b php-block nil @ "<?php" @ "\n" _ "\n" @ "?>" @))
)))
) )
(provide 'init-mmm-mode) (provide 'init-mmm-mode)