Search code examples
emacsnxhtml

Emacs 23 for mixed PHP and HTML


I'm trying to use emacs23.1.1 with nXhtml for web development, writing mixed PHP and HTML. Whenever I do, though, I seem to encounter some strange emacs behaviour.

As one example, I write the following code:

    <?php
        echo "a";
    ?>

As I write the line echo "a";, I go to the previous line and press C-j and start typing - then, as I press ; (, does the same):

    <?php
echo "a";
    ?>

Pressing <TAB> sends the echo back to

    <?php
        echo "a";
    ?>

Very, very annoying... Any ideas?

This is my minified init.el:

(load "~/.emacs.d/lib/nxhtml/autostart.el")

Solution

  • Emacs provides a way around this so far unsolved issue: org-babel allows to line up code from different languages. You may use php-mode than for the php-part. An exporter transfers all into one html finally.

    At [email protected] you should get further help.