>From e16887fd17c24397b3f9709fcb81e522adab13ee Mon Sep 17 00:00:00 2001 From: Brandon Guttersohn Date: Tue, 28 Apr 2020 19:16:41 -0500 Subject: [PATCH] Fix support for non-system C include directives in org-babel C source blocks in org-babel support an ":includes" header argument, which can generate #include directives prior to execution. Without this patch, only system header files (enclosed in < and >) seem to work, as double quotes are neither added nor preserved. With this patch, any include file name which does not begin with a < character will be wrapped in double quotes. --- lisp/org/ob-C.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/org/ob-C.el b/lisp/org/ob-C.el index 3a26bc014b..00711cad12 100644 --- a/lisp/org/ob-C.el +++ b/lisp/org/ob-C.el @@ -232,7 +232,10 @@ org-babel-C-expand-C (list ;; includes (mapconcat - (lambda (inc) (format "#include %s" inc)) + (lambda (inc) + (if (string-prefix-p "<" inc) + (format "#include %s" inc) + (format "#include \"%s\"" inc))) includes "\n") ;; defines (mapconcat -- 2.24.1