From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: How to handle an inline multiline noweb reference Date: Tue, 27 Nov 2018 10:45:38 +0100 Message-ID: <87wooykg59.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRZy9-0003Ng-A5 for emacs-orgmode@gnu.org; Tue, 27 Nov 2018 04:47:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRZy4-0007yX-CW for emacs-orgmode@gnu.org; Tue, 27 Nov 2018 04:47:49 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:51486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRZy4-0007xo-40 for emacs-orgmode@gnu.org; Tue, 27 Nov 2018 04:47:44 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 3C956E65AA for ; Tue, 27 Nov 2018 10:47:39 +0100 (CET) Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bFM4gW_X9zHY for ; Tue, 27 Nov 2018 10:47:36 +0100 (CET) Received: from localhost (83.25.77.124.ipv4.supernova.orange.pl [83.25.77.124]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 5B3A0E65A4 for ; Tue, 27 Nov 2018 10:47:36 +0100 (CET) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org-Mode mailing list Hi folks, I have a multiline source block (a complex sql query). I'd like it to be inserted into another (shell) source block, so that I can run psql on a remote server (via ssh) and execute this query (I cannot access the database from my machine). I came up with this: --8<---------------cut here---------------start------------->8--- #+name: sql_join #+begin_src sql SELECT ... -- complicated, multiline query; #+end_src #+name: sql_oneline #+begin_src elisp :noweb yes (replace-regexp-in-string "\n" " " " <>" t t) #+end_src #+begin_src sh :noweb yes :results output verbatim ssh user@host "psql connector -c '<>'" #+end_src --8<---------------cut here---------------end--------------->8--- but it's fairly complicated. Any better ideas? TIA, -- Marcin Borkowski http://mbork.pl