ob: Support for exporting inline source code
commit795c0043961a127adc4f3d88151e4e052c37c32b
authorNicolas Berthier <nberth@member.fsf.org>
Fri, 13 Jun 2014 13:32:54 +0000 (13 15:32 +0200)
committerNicolas Goaziou <mail@nicolasgoaziou.fr>
Fri, 22 Aug 2014 12:39:38 +0000 (22 14:39 +0200)
tree94bd9d10386abf5b09b97704c4770262996b40bd
parent767895c970589517da213893db003b73e409ead9
ob: Support for exporting inline source code

* lisp/ob-exp.el (org-babel-exp-inline-code-template): New
customizable variable to export inline source code (similar to
`org-babel-exp-code-template').
(org-babel-exp-code): New `type' argument to differentiate between
inline and standard code blocks.

* lisp/ob-core.el (org-babel-inline-src-block-regexp): Allow empty set
of switches and header arguments as in "src_sh[]{echo foo;}".  Also
permit spaces before them.

* testint/lisp/test-org-element.el
(test-org-element/inline-src-block-parser): Test extended syntax for
inline source code.

* testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code): New
function for testing inline source code handling.  Also add three new
failing tests exhibiting unexpected results with ":results code"
switches.

* testing/lisp/test-ob.el
(test-org-babel/org-babel-get-inline-src-block-matches): Test for
inline source blocks with empty header arguments.

* testing/examples/babel.org: New sections for testing (i) exported
inline source code (used by `ob-exp/exports-inline-code'); (ii)
parsing inline source blocks with empty header arguments (used by
`test-org-babel/org-babel-get-inline-src-block-matches').

Until now pieces of inline source code were handled as standard code
blocks during export.  These changes enable them to be exported.
lisp/ob-core.el
lisp/ob-exp.el
testing/examples/babel.org
testing/lisp/test-ob-exp.el
testing/lisp/test-ob.el
testing/lisp/test-org-element.el