From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 5AhbAjvdul9HIAAA0tVLHw (envelope-from ) for ; Sun, 22 Nov 2020 21:50:51 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cByyOTrdul/FAwAAbx9fmQ (envelope-from ) for ; Sun, 22 Nov 2020 21:50:50 +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 8175F9402D6 for ; Sun, 22 Nov 2020 21:50:50 +0000 (UTC) Received: from localhost ([::1]:36616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgxFx-0005xn-7d for larch@yhetil.org; Sun, 22 Nov 2020 16:50:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgxFM-0005wc-97 for emacs-orgmode@gnu.org; Sun, 22 Nov 2020 16:50:12 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:40582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgxFK-0000ol-IE for emacs-orgmode@gnu.org; Sun, 22 Nov 2020 16:50:11 -0500 Received: by mail-pf1-x436.google.com with SMTP id b6so2603917pfp.7 for ; Sun, 22 Nov 2020 13:50:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=6VBSswYQ6lc7T6peQOAO+4o99jOGnm9KXwQv424e4Z0=; b=iUKUO87TOTTr5ponyIuB62gA4wGC62lVejLkRW4O2kNOX1tTGFmTzRDQ8z5zY4OcHN 21QEUuJTcY7+0TaKigAvf+N13X19WEtROQbgegP7BQiREn5wL7n/JHyxc9ArEAilvtF9 5I/+JuDN1DmfRJephmedOTkSA0piRyM3rSluf8xQ8eKPMpnT0khIjmRg8uopaREoed7D BHUclVRpHDHLYjcbfoJxx1ToGG/7zlL9Qr4pf30fsYwwkL8oagUOEWxI4hwAtGPUBPOU hLFj18NT7IBYdX5/BUbaEdPde7of/qORZU2MmvaT54V1ipTB+HwozvQ/oDG2S6QnJhCM XTlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=6VBSswYQ6lc7T6peQOAO+4o99jOGnm9KXwQv424e4Z0=; b=fQz5fryOixX7hozeMCsfidNxdT2TfqotFFCU1jaSGV9xOp+2Ku4Y0QSLKMn+ncVQlH rPY/wr/VvOZ/dkuZEp6L696u1LA+ti0JObKULuryNbWSvEYeuLKKRcTHlSrynpidlPAe yAp06f0S88kBbBYa4uvxi+CJKCCMhl20ynU3eCE6q5jff0IYquGSJ04aKhaOmeb6TLol xVQtRH1mRJRc8TTQu7JxOQbMSi9udIdbdRWrbk0NQFyaFIwym5qd+q+rN2QvUVPwEjwd /nxdxpQDShZYayGGIWSp2XMN+L76sW24XRfjZ/Cfoe6GBQy3L9opK259+umhFgPn2nzt FurQ== X-Gm-Message-State: AOAM530+yHjlRSWt0QB7oieu/zv0/tvptnbyHW1KNjdW2bdZQXAgBuUn PiUahLQuC2MednqKaNVUb/Zwq3IDstw= X-Google-Smtp-Source: ABdhPJyJEfmopo14d1M2YjKmC6ve4cVN8mr5QHBWgWEb0JC188pxCUVmw7WUqs2iGYaUGlqD7Y3mMw== X-Received: by 2002:aa7:9606:0:b029:198:14c4:4f44 with SMTP id q6-20020aa796060000b029019814c44f44mr1341458pfg.80.1606081808216; Sun, 22 Nov 2020 13:50:08 -0800 (PST) Received: from [10.0.0.30] (222-154-26-76-vdsl.sparkbb.co.nz. [222.154.26.76]) by smtp.gmail.com with ESMTPSA id o132sm9533445pfg.100.2020.11.22.13.50.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Nov 2020 13:50:07 -0800 (PST) Subject: Re: Using a code block as input to another code block To: emacs-orgmode@gnu.org References: <87d006z6kl.fsf@therning.org> From: Mike Gauland Message-ID: Date: Mon, 23 Nov 2020 10:50:03 +1300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <87d006z6kl.fsf@therning.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=mikelygee@gmail.com; helo=mail-pf1-x436.google.com 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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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=pass header.d=gmail.com header.s=20161025 header.b=iUKUO87T; dmarc=pass (policy=none) header.from=gmail.com; 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.71 X-TUID: zOy7o85khUxi As far as I know, referencing a code block this way uses the results of executing the block as the variable, not the contents of the block. On 22/11/2020 11:30 am, Magnus Therning wrote: > I know I can use an example block (literal example) as input to a code > block, but I haven't found a way to fontify examples. Since my input is > code (JSON, and various programming languages) I would really like to > have that, as well as the language's mode when editing by using > ~org-edit-source-code~. > > A code block gives me fontification, but I haven't found a way to pass a > code block as is to another code block. > > For instance, something like this: > > #+name: code-input > #+begin_src C > #include > #+end_src > > #+begin_src bash :var input=input :results verbatim > cat < ${input} > EOF > #+end_src > > What are my options? I hope there's either a way to fontify an example, > or to override the default execute function for a code block, or > something else that I'm not thinking of. > > /M > > -- > Magnus Therning OpenPGP: 0x927912051716CE39 > email: magnus@therning.org > twitter: magthe http://magnus.therning.org/ > > I am always doing that which I cannot do, in order that I may learn > how to do it. > — Pablo Picasso