Re: [CEDET-devel] php for cedet
Brought to you by:
zappo
From: Lennart B. (gmail) <len...@gm...> - 2007-05-03 21:09:17
|
Hi Eric and Suraj, I was just notified by Joakim Verona that you are discussing this and maybe I can contribute a bit. It is quite nice to read that you think it is possible to combine nxml-mode and CEDET. Let me explain what I have done in nXhtml so that you can see whether the approch there can be used together with CEDET/Semantic. nxhtml-mode is the preferred mode for editing XHTML in nXhtml. nxhtml-mode is derived from nxml-mode. It is specialized against XHTML and I have added some user interface variations (like popup style completion). There are no deeper technical changes like separating the xml parser from the rest of nxml-mode. (I have thought about it, but I just do not understand how to do it and I do not think that I will be able to understand it in a reasonable time). I use the validation state for completion and I try to set it at the start of the file. That is all. nxhtml-mode has no support for multiple modes in a buffer. Instead multiple modes are supported by another compononet in nXhtml, mumamo-mode. mumamo-mode divides the buffer into chunks with different major modes. When moving into a chunk the major mode in the buffer is switched from the main major mode in the buffer. Indentation and fontification according to that major mode is also supported. The dividing into chunks is made when starting mumamo-mode and after changes. It lives in the buffer in the form of overlays with some properties for mumamo-mode to read later. There is support for surviving buffer local variables when switching major modes while moving between the chunks, but this has to be handcrafted. mumamo-mode can be used separately from nxhtml-mode. (BTW the action of dividing into chunks is a simple approach I have tried to make as stable as possible. I believe it is stable, but I have not taken the time to really investigate if it is or if it can get into an oscillating state.) How does this sound to you? Is there anything special needed in mumamo-mode for it to work with CEDET/Semantic? Is there anything special needed in nxhtml-mode? - L Eric M. Ludlam wrote: > I use nxml mode at work for xml, and can attest to its spiffyness. > > One of these days I'd like to use the xml parser in it to provide > semantic tags, but have not yet had the motivation, as determining > where to put tag class boundaries is custom per schema. > > Using nxhtml would be more deterministic, and make creating a tag > parser a simple matter of list management, and not text parsing. It > would form a nice baseline for starting nxml tag generation as well. > > Thanks for pointing this out Suraj. > Eric > >>>> "Suraj Acharya" <sac...@gm...> seems to think that: >> Also look at Nxhtml mode, which builds on nxml-mode. >> http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html >> It supposedly has support for "PHP, CSS, JavaScript, eRuby, [and] JSP". >> >> >> It requires Emacs 22 however, and you have to convert your any >> existing html to xhtml >> http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html#tidy >> >> I've not used it much myself, but I use nxml-mode a lot and find it very useful. >> >> Suraj >> >> On 5/3/07, Eric M. Ludlam <er...@si...> wrote: >>> If I remember rightly, PHP has mixed-mode issues, meaning you mix >>> html and php code together. You should investigate emacswiki.org and >>> look at mmm-mode, multi-mode, or one of the other options. One of >>> them should have setups for php/html. >>> >>> For CEDET/semantic, I don't know how to combine the two modes together >>> via one of the multi-modes. It should be straight forward to combine >>> a regexp based parser (for html) with a PHP wisent parser. Start w/ >>> PHP code w/out html, and get a wisent parser working there. See the >>> nice wisent manual to get started, and perhaps a simple grammar like >>> the one for awk, calc, or cogre/wisent-dot.wy. >>> >>> Once you have something like that, we can devise a way to combine it >>> w/ the existing html parser. This would be useful, as I suspect there >>> are some folks out there who would like the same features w/ >>> javascript. >>> >>> Good Luck >>> Eric >>> >>>>>> Rohan Nicholls <roh...@go...> seems to think that: >>>> Hi all, >>>> >>>> I have been lurking on this list for a while, and have been reading the >>>> mails, while I get the gumption up to face getting cedet and php working >>>> together. >>>> >>>> As far as I can tell, this means first getting semantic to parse/process >>>> php properly, and other than that I am not sure. >>>> >>>> Could anyone guide me as to what I would need to do to get this to >>>> happen? I have checked out the stuff for java as I thought that would >>>> be pretty close syntactically at least. I have thought about what would >>>> be needed for something like cedet to do its thing, so I think I have a >>>> fairly good idea of what needs to be covered. >>>> >>>> Thanks in advance, all. A friend/colleague of mine would like to chip >>>> in, so that could make things happen. My elisp skills don't suck, but I >>>> am no guru (yet). >>>> >>>> One of the reasons for this is to have a viable (read: emacs based) >>>> option to the zend studio ide closed source bloatware, so we are fairly >>>> motivated, as my first trial of it, was less than revelatory. :) >>>> >>>> Rohan >>> [ ... ] |