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 yFtbCN7gJWDtNwAA0tVLHw (envelope-from ) for ; Fri, 12 Feb 2021 01:58:54 +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 6Pk8BN7gJWDdOAAA1q6Kng (envelope-from ) for ; Fri, 12 Feb 2021 01:58:54 +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 C0B03940355 for ; Fri, 12 Feb 2021 01:58:53 +0000 (UTC) Received: from localhost ([::1]:34334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lANjQ-00045a-Ls for larch@yhetil.org; Thu, 11 Feb 2021 20:58:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lANiO-0003tA-Bv for emacs-orgmode@gnu.org; Thu, 11 Feb 2021 20:57:48 -0500 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:37172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lANiM-0008E5-RA for emacs-orgmode@gnu.org; Thu, 11 Feb 2021 20:57:48 -0500 Received: by mail-qt1-x835.google.com with SMTP id v3so5742198qtw.4 for ; Thu, 11 Feb 2021 17:57:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=ljLIFh+j8kXpPRBToInWKSrE9v0n5uAd6Dd/QTpsMTY=; b=JPhQWN27X0ofpwKqF4qvVjvv1AIeVKr9HDZLKi+pWoNObkXdPgINgnq+BaVOgDhvEj I+ZYeI+T1Kuh15CBZADPQHOtDt6FLfullugCI/7GYKZoXBEW+/K4DlmWQmp196KPA4uu EM9N5m4wi8tfjpD0ktkiZP4HpcpO2yJQd4wU2m43DV44nLhwl+uLcm4eoiZkG9VtcgE0 pDe0ltD+ogq4evqueWkAF63/WfkFSsBUY73Vv258IvQ9RnGmNi9/DKoiQ+I6hhi5hyXc Vvf2VBJBmHKUY8ygysWE4UVWsUw+r7MDRIkRM4NhaUnmi3PlWgvFG8uZrVJXlTeg5rnK DeGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=ljLIFh+j8kXpPRBToInWKSrE9v0n5uAd6Dd/QTpsMTY=; b=kJtn+X7rO6VSzj3bGoPT0zQAwGtQy2WB+gfrHBGu8+JYZdmVrI7JEua67f/l7pSNs3 tcYN0i20+sCvR4N/sdra7bkNCDZICgVtvrBCkEvXHzKQNxvzW0PV/C/5dKtM6Z+3HLJu GM4OPh8ex/qbstgW7L8j72vsKupjHJiyfa05JPzolcGbYM4UzE1HR9J/xF7ckfG+Vy5+ mMMwB5tn6iPiw+es0hu59IHXoZ1okhzf9hE8oGDUYyR2xKKu0x14Gws5Kj1I/80+T/o1 2GeM511LhWSrAQVVWdLkbkT6RMw8kDiFB3me+5AZklrbPkGwREjxN30eKcbz4RzV0L5a kAgA== X-Gm-Message-State: AOAM531hTCAnCdlzHzYqJturxqbs9uF1fuNM4rw/ApOvd2Mz2rHsNbjQ Ke9ArK8JophsFh6HBKSgYw9DtADaQlE= X-Google-Smtp-Source: ABdhPJyYm3hdpqwmwk51aXVm6eqDPqWB/z7KcyLoxevRCIm3R0RsSbf6ejHqcdpIPiowLlgqFVO3FA== X-Received: by 2002:ac8:6f04:: with SMTP id g4mr644926qtv.20.1613095064414; Thu, 11 Feb 2021 17:57:44 -0800 (PST) Received: from localhost ([190.239.232.181]) by smtp.gmail.com with ESMTPSA id q15sm4836260qti.9.2021.02.11.17.57.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 17:57:44 -0800 (PST) User-agent: mu4e 1.4.14; emacs 27.1 From: Rodrigo Morales To: emacs-orgmode@gnu.org Subject: How to get the content of a code block by its name? Date: Thu, 11 Feb 2021 20:54:12 -0500 Message-ID: <87blcqhwzf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-qt1-x835.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=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-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.06 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=JPhQWN27; 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-Migadu-Queue-Id: C0B03940355 X-Spam-Score: -2.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: MhFTcj16tPgo * The question Let's suppose I have this simple code block in a buffer (let's say =A=) #+NAME: five-numbers #+begin_src bash echo foo seq 1 5 echo bar #+end_src How can I get the content of the code block with name =five-numbers= as an string from any point in buffer =A=? * Additional information I'm asking this because I would like to have a function which would help me insert a code block in the =:prologue= header argument of another code block. #+begin_src bash :prologue (get-code-block-as-string "five-numbers") echo a #+end_src -- Greetings, Rodrigo Morales. IRC: rdrg109 (freenode)