Skip to content

Commit da270ae

Browse files
committed
use clean output after initialisation. remove duplicate usage.
1 parent 5a77a8f commit da270ae

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

ob-sql.el

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ This function is called by `org-babel-execute-src-block'."
291291
(org-babel-temp-file "sql-out-")))
292292
(session (cdr (assoc :session params)))
293293
(session-p (not (string= session "none")))
294-
(clean-output (plist-get org-sql-session-clean-output in-engine))
295294
(header-delim ""))
296295

297296
(if (or session-p org-sql-run-comint-p)
@@ -326,8 +325,9 @@ This function is called by `org-babel-execute-src-block'."
326325
(with-current-buffer (get-buffer-create "*ob-sql-result*")
327326
(goto-char (point-min))
328327
;; clear the output or prompt and termination
329-
(while (re-search-forward clean-output nil t)
330-
(replace-match ""))
328+
(let ((clean-output (plist-get org-sql-session-clean-output in-engine)))
329+
(while (re-search-forward clean-output nil t)
330+
(replace-match "")))
331331
(write-file out-file)))
332332

333333
;; else, command line
@@ -465,12 +465,6 @@ SET COLSEP '|'
465465
(forward-char -1))
466466
(write-file out-file))))
467467

468-
(when session-p
469-
(goto-char (point-min))
470-
;; clear the output of prompt and termination
471-
(while (re-search-forward clean-output nil t)
472-
(replace-match "")))
473-
474468
(org-table-import out-file (if (string= engine "sqsh") '(4) '(16)))
475469
(when org-sql-close-out-temp-buffer-p
476470
(kill-buffer (get-file-buffer out-file)))

0 commit comments

Comments
 (0)