emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 312deaa13a 03/17: * lisp/ob-C.el: Add support for :


From: ELPA Syncer
Subject: [elpa] externals/org 312deaa13a 03/17: * lisp/ob-C.el: Add support for :prologue/:epilogue parameters
Date: Thu, 19 Oct 2023 06:58:51 -0400 (EDT)

branch: externals/org
commit 312deaa13a0f19932f3e22d4c8b5823bf342d863
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]