[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] ob-sql: blocks without :engine get stuck in org-edit-src-code on
From: |
Ivan Sokolov |
Subject: |
[PATCH] ob-sql: blocks without :engine get stuck in org-edit-src-code on indent |
Date: |
Tue, 20 Apr 2021 18:41:06 +0300 |
user-error in sql-set-product interrupts normal execution flow in
org-indent-line for sql blocks without :engine.
Provided patch is not the best solution, but I do not have the time or
inclination to mess around with anything outside of the org-mode itself.
>From 8768e1c245ab0c0d2d8f8ac830f39ac89d23a839 Mon Sep 17 00:00:00 2001
From: Ivan Sokolov <ivan-p-sokolov@ya.ru>
Date: Tue, 20 Apr 2021 18:22:21 +0300
Subject: [PATCH] ob-sql: do not stuck on user-error in sql-set-product
---
lisp/ob-sql.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 7c359b988..4e61253bf 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -98,7 +98,9 @@
Set `sql-product' in Org edit buffer according to the
corresponding :engine source block header argument."
(let ((product (cdr (assq :engine (nth 2 info)))))
- (sql-set-product product)))
+ (condition-case _error
+ (sql-set-product product)
+ (user-error))))
(defun org-babel-sql-dbstring-mysql (host port user password database)
"Make MySQL cmd line args for database connection. Pass nil to omit that
arg."
--
2.31.1
- [PATCH] ob-sql: blocks without :engine get stuck in org-edit-src-code on indent,
Ivan Sokolov <=