[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Indenting according to block

From: Lennart Borgman (gmail)
Subject: Re: Indenting according to block
Date: Fri, 29 Jun 2007 23:01:07 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070604 Thunderbird/ Mnenhy/

troelskn wrote:

Sorry if this has been asked a gazillion times before (Which I suspect
it has), but I don't really know what to search for.

I'm using Emacs primarily for writing PHP. The PHP-mode appears to
extend from C-mode. The auto-indent is not formatting code the way I
would like it to, so I would obviously like to change that.
The basic rules, by which I'm used to indent code is, that for each
block-scope, I increase indentation by one tab (Well actually by 2
spaces, since I don't use tabs). However, the way Emacs does it now,
is to indent the line by a number of spaces, which corresponds to the
end-column of the previous line. I think that's called indent-

Does the indentation-rules, I described have a name? And is there
support build into Emacs for it?

Hi Troels,

The PHP modes I have seen does not indent all parts correctly. The HTML part is not handled.

There is a solution however, a working solution - but still with some bugs. I think that most of the time it will work.

The solution I know about is nXhtml. nXhtml includes support for multiple major modes in a buffer. The HTML parts are handles by nxhtml-mode (or html-mode) and the PHP parts by php-mode.

The home page is at

I plan to upload a new version as soon as I get time. As I do the changes in my sources I use to note them immediately in the list of changes you can find from the home page. So you can already see what the next version will contain (though I plan some more changes than those currently noted there).

You will need Emacs 22 to use nXhtml.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]