瀏覽代碼

lisp/ob-sql.el: Prevent from getting stuck with an error

* lisp/ob-sql.el (org-babel-edit-prep:sql): Prevent from getting
stuck with an error.

TINYCHANGE
Ivan Sokolov 4 年之前
父節點
當前提交
45ca597f96
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      lisp/ob-sql.el

+ 3 - 1
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 nil
+        (sql-set-product product)
+      (user-error "Cannot set `sql-product' in Org Src edit buffer"))))
 
 (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."