org-element: Optimize affiliated keywords parsing
commitbaed7dc7db5bd3019c44eace89027e119dd9e6b5
authorNicolas Goaziou <n.goaziou@gmail.com>
Thu, 20 Sep 2012 17:10:39 +0000 (20 19:10 +0200)
committerNicolas Goaziou <n.goaziou@gmail.com>
Thu, 20 Sep 2012 18:08:16 +0000 (20 20:08 +0200)
treebf957301b6d9a36702679c3d9ce2db390b6d6e77
parent7c40e0c6ba503ba3829f14b4d8af6ba9b3e0241d
org-element: Optimize affiliated keywords parsing

* lisp/org-element.el (org-element-center-block-parser,
  org-element-drawer-parser, org-element-dynamic-block-parser,
  org-element-footnote-definition-parser,
  org-element-plain-list-parser, org-element-quote-block-parser,
  org-element-special-block-parser, org-element-babel-call-parser,
  org-element-comment-parser, org-element-comment-block-parser,
  org-element-example-block-parser, org-element-export-block-parser,
  org-element-fixed-width-parser, org-element-horizontal-rule-parser,
  org-element-keyword-parser, org-element-latex-environment-parser,
  org-element-paragraph-parser, org-element-property-drawer-parser,
  org-element-src-block-parser, org-element-table-parser,
  org-element-verse-block-parser): Change signature. Now use an
  additional argument: affiliated.
(org-element--current-element): Skip affiliated keywords and pass them
  as an argument to parsers.  It prevents to walk through these
  keywords twice: the first time to get to the first line of the
  element, and a second time to collect the affiliated keywords.
* contrib/lisp/org-export.el (org-export-get-caption): Update function
  since multiple affiliated keywords are now reversed.
* testing/lisp/test-org-element.el: Update tests.
contrib/lisp/org-export.el
lisp/org-element.el
testing/lisp/test-org-element.el