From 7df89c484616703b7e1833260812389030e0bdbc Mon Sep 17 00:00:00 2001 From: Phil Estival Date: Thu, 16 Jan 2025 15:28:55 +0100 Subject: [PATCH 05/11] ob-sql: turn a unique (cond expression) to a (when expression) --- lisp/ob-sql.el | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el index 0a9ea5c87..976f673ee 100644 --- a/lisp/ob-sql.el +++ b/lisp/ob-sql.el @@ -413,15 +413,13 @@ SET COLSEP '|' (cond ((memq (intern engine) '(dbi mysql postgresql postgres saphana sqsh vertica)) ;; Add header row delimiter after column-names header in first line - (cond - (colnames-p - (with-temp-buffer - (insert-file-contents out-file) - (goto-char (point-min)) - (forward-line 1) - (insert "-\n") - (setq header-delim "-") - (write-file out-file))))) + (when colnames-p (with-temp-buffer + (insert-file-contents out-file) + (goto-char (point-min)) + (forward-line 1) + (insert "-\n") + (setq header-delim "-") + (write-file out-file)))) (t ;; Need to figure out the delimiter for the header row (with-temp-buffer -- 2.39.5