From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id deC1GziavV8PaAAA0tVLHw (envelope-from ) for ; Tue, 24 Nov 2020 23:41:44 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id mGkAFziavV8/RAAA1q6Kng (envelope-from ) for ; Tue, 24 Nov 2020 23:41:44 +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 05D3F9402A5 for ; Tue, 24 Nov 2020 23:41:43 +0000 (UTC) Received: from localhost ([::1]:43874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khhwM-0005zq-9A for larch@yhetil.org; Tue, 24 Nov 2020 18:41:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khhvK-0005yi-5m for emacs-orgmode@gnu.org; Tue, 24 Nov 2020 18:40:38 -0500 Received: from andalucia.tim-landscheidt.de ([2a01:4f8:1c1c:d4d0::1]:44054) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khhvE-0005Gk-TC for emacs-orgmode@gnu.org; Tue, 24 Nov 2020 18:40:37 -0500 Received: from dslb-090-186-126-165.090.186.pools.vodafone-ip.de ([90.186.126.165]:55284 helo=passepartout.tim-landscheidt.de) by andalucia.tim-landscheidt.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1khhvA-0002M4-SV for emacs-orgmode@gnu.org; Wed, 25 Nov 2020 00:40:28 +0100 From: Tim Landscheidt To: emacs-orgmode@gnu.org Subject: Bug: :prologue and :epilogue are ignored in ob-sql code blocks (inter alia) Organization: http://www.tim-landscheidt.de/ Date: Tue, 24 Nov 2020 23:40:28 +0000 Message-ID: <87k0uauxw3.fsf@passepartout.tim-landscheidt.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a01:4f8:1c1c:d4d0::1; envelope-from=tim@tim-landscheidt.de; helo=andalucia.tim-landscheidt.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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-Spam-Score: -1.01 X-TUID: yIrYZNwv+BVZ With Emacs 27.1/org-mode 9.3, "(org) Environment of a Code Block" ends with: | Inserting headers and footers | ----------------------------- | The =E2=80=98prologue=E2=80=99 header argument is for appending to the to= p of the code | block for execution, like a reset instruction. For example, you may use | =E2=80=98:prologue "reset"=E2=80=99 in a Gnuplot code block or, for every= such block: | | (add-to-list 'org-babel-default-header-args:gnuplot | '((:prologue . "reset"))) | Likewise, the value of the =E2=80=98epilogue=E2=80=99 header argument = is for | appending to the end of the code block for execution. However it appears as if :prologue and :epilogue are ignored in ob-sql code blocks: | #+NAME: test-for-ob-sql | #+BEGIN_SRC sql :engine postgresql :results verbatim :prologue "SELECT 1;= " :epilogue "SELECT 5;" :cmdline --no-psqlrc -P format=3Daligned -P footer= =3Don | SELECT 2; | SELECT 3; | SELECT 4; | #+END_SRC | #+RESULTS: test-for-ob-sql | #+begin_example | ?column? | ---------- | 2 | (1 Zeile) | ?column? | ---------- | 3 | (1 Zeile) | ?column? | ---------- | 4 | (1 Zeile) | #+end_example It seems that :prologue and :epilogue are only honoured in languages that use org-babel-expand-body:generic and a (very) few others; especially, the following languages prob- ably ignore them (untested): | [tim@passepartout ~/src/emacs]$ find lisp/org -type f -name ob-\*.el \ | > -not -exec fgrep -q 'org-babel-expand-body:generic' {} \; \ | > -not -exec fgrep -q ':prologue' {} \; \ | > -print | lisp/org/ob-C.el | lisp/org/ob-J.el | lisp/org/ob-abc.el | lisp/org/ob-awk.el | lisp/org/ob-calc.el | lisp/org/ob-clojure.el | lisp/org/ob-comint.el | lisp/org/ob-css.el | lisp/org/ob-ditaa.el | lisp/org/ob-dot.el | lisp/org/ob-ebnf.el | lisp/org/ob-emacs-lisp.el | lisp/org/ob-eval.el | lisp/org/ob-exp.el | lisp/org/ob-fortran.el | lisp/org/ob-hledger.el | lisp/org/ob-latex.el | lisp/org/ob-ledger.el | lisp/org/ob-lisp.el | lisp/org/ob-lob.el | lisp/org/ob-makefile.el | lisp/org/ob-matlab.el | lisp/org/ob-mscgen.el | lisp/org/ob-org.el | lisp/org/ob-picolisp.el | lisp/org/ob-ref.el | lisp/org/ob-sed.el | lisp/org/ob-shen.el | lisp/org/ob-sql.el | lisp/org/ob-sqlite.el | lisp/org/ob-table.el | lisp/org/ob-stan.el | lisp/org/ob-vala.el