branch: externals/org commit 312deaa13a0f19932f3e22d4c8b5823bf342d863 Author: Ihor Radchenko <yanta...@posteo.net> Commit: Ihor Radchenko <yanta...@posteo.net>
* lisp/ob-C.el: Add support for :prologue/:epilogue parameters (org-babel-C-expand-C): --- lisp/ob-C.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ob-C.el b/lisp/ob-C.el index 9a24c079e9..0278fc02a7 100644 --- a/lisp/ob-C.el +++ b/lisp/ob-C.el @@ -213,7 +213,9 @@ This function should only be called by `org-babel-execute:C' or nil)) (namespaces (org-babel-read (cdr (assq :namespaces params)) - nil))) + nil)) + (prologue (cdr (assq :prologue params))) + (epilogue (cdr (assq :epilogue params)))) (when (stringp includes) (setq includes (split-string includes))) (when (stringp namespaces) @@ -227,6 +229,11 @@ This function should only be called by `org-babel-execute:C' or (nconc result (list (concat y " " x))) (setq y nil))) (setq defines (cdr result)))) + (setq body + (concat + (and prologue (concat prologue "\n")) + body + (and epilogue (concat "\n" epilogue "\n")))) (mapconcat 'identity (list ;; includes