From 3ba23fecd34f75bd4a18ed9dc75044adb9c58e6c Mon Sep 17 00:00:00 2001 From: Phil Estival Date: Tue, 7 Jan 2025 03:44:52 +0100 Subject: [PATCH 3/5] lisp/ob-sql.el: expand body discarding nil prologue or epilogue --- lisp/ob-sql.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el index df0059492..970363f7d 100644 --- a/lisp/ob-sql.el +++ b/lisp/ob-sql.el @@ -155,11 +155,10 @@ (let ((prologue (cdr (assq :prologue params))) (epilogue (cdr (assq :epilogue params)))) (mapconcat 'identity - (list - prologue - (org-babel-sql-expand-vars - body (org-babel--get-vars params)) - epilogue) + (delq nil (list prologue + (org-babel-sql-expand-vars + body (org-babel--get-vars params)) + epilogue)) "\n"))) (defun org-babel-edit-prep:sql (info) -- 2.39.5