branch: externals/org
commit 92b69d4331f080026b675dacea40dd1fb961ec2b
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    * lisp/ob-java.el: Add support for :prologue/:epilogue parameters
    
    (org-babel-expand-body:java):
---
 lisp/ob-java.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-java.el b/lisp/ob-java.el
index 8938605266..814d9f5e3a 100644
--- a/lisp/ob-java.el
+++ b/lisp/ob-java.el
@@ -341,9 +341,13 @@ is simplest to expand the code block from the inside out."
          (imports-val (assq :imports params))
          (imports (if imports-val
                       (split-string (org-babel-read (cdr imports-val) nil) " ")
-                    nil)))
+                    nil))
+         (prologue (cdr (assq :prologue params)))
+         (epilogue (cdr (assq :epilogue params))))
     (with-temp-buffer
+      (when prologue (insert prologue "\n"))
       (insert body)
+      (when epilogue (insert "\n" epilogue))
 
       ;; wrap main.  If there are methods defined, but no main method
       ;; and no class, wrap everything in a generic main method.

Reply via email to