From: xslide S. <xsl...@me...> - 2003-06-27 09:26:29
|
At 24 Jun 2003 20:21 -0400, Glen Peterson wrote: > On Wed, 2003-06-18 at 21:56, Tony Graham wrote: ... > > I have noticed, however, that Emacs 21 has hash tables, which may also > > be useful for part of this. > > I imagine hash-tables are slower than indexing vectors or arrays because > you have to compare against each hash before finding the one you want. What we have now is an alist, which means a linear search. > By the time we add support for xsl, xslfo, html, and whatever other > group of element and attribute names, this could become a problem. > Plus, if we are going to make an elegant solution, I'd rather make a > macro to create get and set methods that access offsets into arrays or > Vectors. I think we're talking at cross-purposes here. Yes, get and set methods for the values associated with an individual element or attribute. A hash table of all of the structures/lists/vectors/arrays for the elements (and one for the attributes) that are keyed from the element or attribute name. One element and one attribute hash/obarray/whatever per namespace. The structures and hashes are built at startup from the data in Customize (although both an XML format and the ability to save compiled structure hashes would be useful). One use case is to be able to successfully fontify an XSLT stylesheet that produces another XSLT stylesheet: you have XSLT elements in two namespaces, at least one prefix for which is not going to be 'xsl:'. xslide, therefore, has to know to recognise this namespace aliasing, and it has to build its font-lock-keywords on-the-fly to cope. > I asked a lisp hacker about this and he told me to check out defstruct. > My initial experiments show it to be interesting. This lisp hacker Yes, it does look interesting. `defstruct' is part of the Common Lisp extensions, at least on Emacs 20.7, but xslide currently requires the cl package anyway. > brightened when I told him my question was for xslide. He said that he > uses it in XEmacs even to edit html and really likes it. Good work Tony > and friends! He's not the first person that I've heard of that uses xslide for HTML. ... > Customize is a good idea. I had also imagined being able to hit f1 when > your cursor is on a tag and get a help window describing that tag - > basically by parsing the same data structure that describes everything > about these tags, and putting some plain English text around it. I > actually have a prototype working. I want the W3C Recommendations for XSLT and XSL as Info files and to be able to get from an element to its definition in the Info files. There is a limit to how much people will want to put in Customize fields, and I don't want to have to enter everything for XSLT and XSL. ... > > Actually, I'd like to move to using the semantic bovinator for a lot > > of this, but I don't have time to delve into it myself. > > bovinator? I'm skeptical. I'm having too much fun writing the lisp by > hand right now anyway. I want to use the semantic bovinator and associated stuff so the font-lock stuff becomes more intelligent, as would the automatic addition of required attributes, plus it would lead to being able to support a 'tree view' of templates using speedbar. You might have fun writing the lisp, but not everybody is going to be able to write lisp to support for their tag set. ... > Would it be to our advantage to consider scaling the development effort > on this project? Have you ever considered merging with sgml-mode? How My DTD mode started out as a minor mode of sgml-mode, so I have some experience in that direction. sgml-mode isn't going to be able to validate your average XSL file, so a lot of its features won't apply. I do sometimes think of PSGML's API for finding where you are in the document, but I haven't looked closely at it. > far will "If it's good, people will use it" take us? What happened to > all the other people whose names are in the source code? These are more They contributed patches. > honest questions than suggestions for me right now. Questions are welcome. Regards, Tony Graham. |