Hi Adam, > This is a very interesting idea, and I don't want to dismiss your work, > but I am concerned about how much third-party code will likely break by > changing the results returned by org-element for parsing an Org buffer. > I haven't thoroughly studied all of the code in your patches, so I may > be wrong, but I think the breakage could be extensive. For example, > simple operations like destructuring the results of org-element parsing > functions may be broken. Have you done any investigation into this > issue? > > Maybe there should be a transitional period in which the existing > org-element parsing functions would work as before, and the new > document-level elements would be returned by a new org-element > document-level parsing function. Frankly, if there is breakage,the > transition would probably take a few years, because there is a lot of > code out there that has worked for years and may not be updated or > replaced for years.
I have not investigated much into that to be honest. I'd argue that it's a fairly trivial change in terms of the parser though. Everything will work as before except when you're after the whole buffer syntax-tree. In that case one will have to dig one step deeper into the tree to find the content. Previous tree: (org-data nil CONTENTS) With this patch: (org-data nil (document (doc-props) CONTENTS)) Yeah.. The structure changed a bit. But it's a fairly trivial change in my opinion. Everything else works as before AFAIK... But I might be overseeing something. Please enlighten me in that case! I've made specification-changes only at two locations in the test-cases for org-element. (ref. patch nr.1) Best Gustav