From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cEhfFTr2fmAhjwAAgWs5BA (envelope-from ) for ; Tue, 20 Apr 2021 17:41:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SDsgETr2fmAzXQAA1q6Kng (envelope-from ) for ; Tue, 20 Apr 2021 15:41:46 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8557B252FA for ; Tue, 20 Apr 2021 17:41:45 +0200 (CEST) Received: from localhost ([::1]:58766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYsVT-00007N-L0 for larch@yhetil.org; Tue, 20 Apr 2021 11:41:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYsV6-00007B-16 for emacs-orgmode@gnu.org; Tue, 20 Apr 2021 11:41:20 -0400 Received: from forward102j.mail.yandex.net ([2a02:6b8:0:801:2::102]:54558) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYsV2-0007zV-LV for emacs-orgmode@gnu.org; Tue, 20 Apr 2021 11:41:19 -0400 Received: from sas1-185358ff6438.qloud-c.yandex.net (sas1-185358ff6438.qloud-c.yandex.net [IPv6:2a02:6b8:c08:101a:0:640:1853:58ff]) by forward102j.mail.yandex.net (Yandex) with ESMTP id DD9D1F21184 for ; Tue, 20 Apr 2021 18:41:08 +0300 (MSK) Received: from sas1-e20a8b944cac.qloud-c.yandex.net (sas1-e20a8b944cac.qloud-c.yandex.net [2a02:6b8:c14:6696:0:640:e20a:8b94]) by sas1-185358ff6438.qloud-c.yandex.net (mxback/Yandex) with ESMTP id auGWmttC4R-f8Iu4o6x; Tue, 20 Apr 2021 18:41:08 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1618933268; bh=ZbY5z33jh2iJR4dwHMLmbd0jgEPlx2S+YHXcCKC78G4=; h=Date:Subject:To:From:Message-ID; b=APRQtVkselFN7ZMByzYTl+ua88UFb1osWm/NAGF9m46jZo+4qcgpXLyR7Sq6GqttY NXqLPuK7EvmDPLMtuC6RsLhsafI2DLjCX4c3y/7YKFw+2DC+RkiWWtwh/2eRm+EGIZ E3cZiYCxu4FvX3D/lQrc0O7J1b96+ppEr3RVQEXc= Received: by sas1-e20a8b944cac.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id DrhKJTrYs1-f8LmoY05; Tue, 20 Apr 2021 18:41:08 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Ivan Sokolov To: emacs-orgmode@gnu.org 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 Message-ID: <877dkxc6b1.fsf@ya.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a02:6b8:0:801:2::102; envelope-from=ivan-p-sokolov@ya.ru; helo=forward102j.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618933305; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ZbY5z33jh2iJR4dwHMLmbd0jgEPlx2S+YHXcCKC78G4=; b=szAPcVoq4EQwjbRK1ZXcBU46YZIssnC3Pu6l+o5JuWBs6lDF18jQuwIiZPRWwdNIRR9daq nUfltWjqxpPWKJbA32jNPWA6Xx9R5SfRqhH3E0QWUXt5VwEdcfB/sfSypauH9tU76FV22w 4/XLbiuyb5tz58580xV1BIF8EMu3LY4b0s8zvPAcCcaPCoICqGvvJ1L8qzRCK5Wg3RNdj8 PNh0USwQrRnmqGVLRYb7vrr8TCZa0VOQwi0Ea6BSV9/T58K+0YpdoRlP24iTj56tw5za+Y ZySjt8uq9+QB1nr1WkvKVFbmNH/A5VotOEJxqVXRoh28GzKYmT/xluRartknbA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618933306; a=rsa-sha256; cv=none; b=ks3V8ngkQAWfRXVYph3lcO+4rWC/+WQGKVVUqiBLoAxpfXmpRHKcj/5GurSXOuGOGw6vBi zifb080meek8cS255FHhibZS2EkeEIQ8oYVgT/97rFyTCC4eoGxK6m+Ut2X4ri7vlhciTM 7duicI/UyS2u82wUIOc0joAXyYcnoWKWw2lqWz5Fxt1akPtOjptREqTN5xqja7lhFWW3aK CBt2lo7fkXNcJr8OzIfxi25D5oAPl8FwUbupzVGJJAnkrcXjvPa7eln7+rdPIHhXZhkbJT 43A+HKTJfTaMz+gQ9KlqR3gjXt2b7zFeQjpgSF2HIGlZVjf741ou2Admk7Vqtg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=ya.ru header.s=mail header.b=APRQtVks; dmarc=pass (policy=none) header.from=ya.ru; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=ya.ru header.s=mail header.b=APRQtVks; dmarc=pass (policy=none) header.from=ya.ru; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 8557B252FA X-Spam-Score: -3.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: P7f0P1wmQYIc --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ob-sql-do-not-stuck-on-user-error-in-sql-set-product.patch >From 8768e1c245ab0c0d2d8f8ac830f39ac89d23a839 Mon Sep 17 00:00:00 2001 From: Ivan Sokolov 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 --=-=-=--