* PHP+HTML with mmm-mode
@ 2007-08-20 10:54 ignat.skoryh
2007-08-20 12:11 ` Hadron
0 siblings, 1 reply; 2+ messages in thread
From: ignat.skoryh @ 2007-08-20 10:54 UTC (permalink / raw)
To: help-gnu-emacs
I'm trying to setup my emacs to edit PHP code with mmm-mode. I was
able to make it switch to different major modes (html and php
accordingly), but it fails to highlight embedded php code correctly,
as you can see on the screenshot: http://www.javaparts.com/dst/emacs-html-php-mode.png.
As you can see mmm-mode adds background color around php regions, but
inside those regions keywords (e.g. if) are not highlighted. What am I
doing wrong?
Here is my .emacs initialization:
;; Use HTML mode for php files
(add-to-list 'auto-mode-alist '("\\.php$" . html-mode))
;; Load MMM
(require 'mmm-mode)
(setq mmm-global-mode 'maybe)
(setq mmm-submode-decoration-level 2)
(set-face-background 'mmm-code-submode-face "gray15")
(mmm-add-classes
'((php-in-html
:submode php-mode
:face mmm-code-submode-face
:front "<\\?\\(php=?\\)?"
:back "\\?>"
:include-front t
:include-back t)))
(mmm-add-mode-ext-class 'html-mode "\\.php$" 'php-in-html)
;; Colors
(global-font-lock-mode t)
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PHP+HTML with mmm-mode
2007-08-20 10:54 PHP+HTML with mmm-mode ignat.skoryh
@ 2007-08-20 12:11 ` Hadron
0 siblings, 0 replies; 2+ messages in thread
From: Hadron @ 2007-08-20 12:11 UTC (permalink / raw)
To: help-gnu-emacs
ignat.skoryh@gmail.com writes:
> I'm trying to setup my emacs to edit PHP code with mmm-mode. I was
> able to make it switch to different major modes (html and php
> accordingly), but it fails to highlight embedded php code correctly,
> as you can see on the screenshot: http://www.javaparts.com/dst/emacs-html-php-mode.png.
> As you can see mmm-mode adds background color around php regions, but
> inside those regions keywords (e.g. if) are not highlighted. What am I
> doing wrong?
I now use nxhtml from Lennart. I still have a few issues with it,
but it works very well and Lennart is always there for support.
http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html
ps Why don't you explicitly state the script? e.g
<?php ....?>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-20 12:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-20 10:54 PHP+HTML with mmm-mode ignat.skoryh
2007-08-20 12:11 ` Hadron
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.