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 8AKHEs1NPGBSHwAA0tVLHw (envelope-from ) for ; Mon, 01 Mar 2021 02:13:33 +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 cBw9Ds1NPGD9OQAAbx9fmQ (envelope-from ) for ; Mon, 01 Mar 2021 02:13:33 +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 4732A17E73 for ; Mon, 1 Mar 2021 03:13:32 +0100 (CET) Received: from localhost ([::1]:52700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGY3u-0000EB-5G for larch@yhetil.org; Sun, 28 Feb 2021 21:13:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGY3K-0000Dy-2f for emacs-orgmode@gnu.org; Sun, 28 Feb 2021 21:12:54 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:35373) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lGY3I-0005Sn-3y for emacs-orgmode@gnu.org; Sun, 28 Feb 2021 21:12:53 -0500 Received: by mail-ed1-x535.google.com with SMTP id p1so14181083edy.2 for ; Sun, 28 Feb 2021 18:12:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nzSyShItPoOit0FxBazyjAG6ywo4OkKXq7zzhSv3Pps=; b=vUQOdK/jKKlU57LuRRhzUEhLnMRZyhTEEr7K8c3RQOSOjUcHtOQYTa5iHkXPCaqVMK vdkEAnUZ+Ik6+zXmrzP6yzsv1bLTTzJramXkYXsPWoC264MTNQjU9WuJhk7KB7w5Pz9Y BC4EkLi0kfaScQ9gTpMllFs4Bb8EK3ocKqDXqHGYT543lTFAqr62X4ZqYGtP5sj871EK ft1q6Ll9lzm66xpkLMPnvpYiWB16XTRHd7IsFFX6386D/951QP28VnnwAtx/uDDnR8pl gM6Z5OXToXxg90McrqKTKIeUlZW3noX832SOk78E5gAeig73HT5/KpvkxMgsiRiyamOt A5qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nzSyShItPoOit0FxBazyjAG6ywo4OkKXq7zzhSv3Pps=; b=kOpgCFEILBqc5Gpwbv065eKNZLa36hKzAByEIVVez6TrIrR/17b7qX7MsjuNpgsp+t WN9HkI2f7gvstHK2Nu/QS8R1wwHz7DuaNaRYukEgHmJIrxNRs1NkuxPMOaNgEWDDHOw2 HFM/7kegb/esZoUg4HpN2sm8uKd889xhofAV6RbQw3+dPN/he1IvPV1y986X/7xYPQSf MUwx4XiBLdyZ/HkiOb3fGM+UQ87wuPyAfJORsP4E+IyVGXFFCVx/mxO6sz9FWvO93MAO YIdqi0VDzQkprw+nMzW85SUyYUvt1kMvSxxC/oZ14Gm8F23sgecUaSh9yD49AWWsf2n2 nKnA== X-Gm-Message-State: AOAM533/pqp108PIoPwotGfjPSMsprJjo0AhYCytd9qSHmT75hT3b0PC 3/yn+LDaFAQjbsGXm+pIBWaiIIQ0gxCUjpumCw== X-Google-Smtp-Source: ABdhPJxWFqzEUz0qeBdxICCgrXMnLtE68Jf5gtRRjbtNCFwN/Kmsb8AgmoixV9m9CdA1HivbcXyibsxTYEszbq6Ls84= X-Received: by 2002:a05:6402:38d:: with SMTP id o13mr12949392edv.337.1614564770425; Sun, 28 Feb 2021 18:12:50 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nathan Neff Date: Sun, 28 Feb 2021 20:12:39 -0600 Message-ID: Subject: Re: Babel: Programmatically evaluate a heading and subtrees? To: ian martins Content-Type: multipart/alternative; boundary="0000000000009bad8605bc70272a" Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=nathan.neff@gmail.com; helo=mail-ed1-x535.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, HTML_MESSAGE=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: , Cc: emacs-orgmode 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=1614564813; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=nzSyShItPoOit0FxBazyjAG6ywo4OkKXq7zzhSv3Pps=; b=S8cniUC/R0NQLmo+/m/mYWVfi8kRWLThrKPgP1GEmRFLZHdQtO/afeowkrJZhiVK0DNsWP YtTqcWanUiLfzCOtiMN2gZHy7zApVr6C+PlAxlOce3geSqQFk7zAGFspWaCA7x+zAVBw1e cLanpQw1YywYdZJ+O6mdlBS46Ti1LkQAe1tnIVRMo3exAc3xDZm8osEHk+3QYcfNOiY2eF bB4M8X3suJfVDmTbO9d5xsCaVBqtC8a/KGbtgK6tQhoQl6bP0FViqK1MuqOLSlsCyOmLyT QSf6/xV8owlbKnvaYUEeM3H6mxF2C0KOS+bcghEO/YNeNsQQlBntFy7ntoJaow== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614564813; a=rsa-sha256; cv=none; b=JDJ33hIVEA6U0XUFiCw9NSM37MXtHKJxrUXPNe/uZ31p11qMy4ymfVEn57h2UDhL+DuAb/ zG56guoGwDrAsyBBs0VrGvP/PPo1eaG4bst/PRPuwrVc0wytEP58vS4UI4PyDtm+N1byDL R8u1XorH3ERjyRKF0Bz6r1U5gIPlaqLEgaX8ZvnzIC4EdHQpWpb4+0rsfl9QIcSGQnaCrB 5ceS1tyYdilG/VyRsB0wLZPCrYREYcrF5PLeHKR46edWMEGpAYp25rkEYOVz31ia9POOe2 FdA+IScqES15jgFt0RO4MYBrK37vG/6SsIHMrvLmWcie1qgFi55gFEHz7HMCiA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="vUQOdK/j"; 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-Spam-Score: -0.56 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="vUQOdK/j"; 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: 4732A17E73 X-Spam-Score: -0.56 X-Migadu-Scanner: scn0.migadu.com X-TUID: 59E2wCvTL1Qb --0000000000009bad8605bc70272a Content-Type: text/plain; charset="UTF-8" On Sat, Feb 27, 2021 at 7:18 AM ian martins wrote: > Can you use noweb? In the example below, if you run the top code block > babel will run the two that follow. > Hi Ian, yes, I can run the top code block *manually* by navigating to that block and then evaluating it. I would like to define a keyboard shortcut that will call the function and its subheadings' functions. > > A drawback is that you have to redefine variables, but it might be a > benefit, since the individual blocks could be set with test data and > the "main driver" could point to real data. > ------- > > #+begin_src elisp :results output :noweb yes :var data=data1 > <> > <> > #+end_src > > #+RESULTS: > : called fun1: some data > : called fun2 > > #+name: data1 > some data > > #+name: fun1 > #+begin_src elisp :var data=data1 > (princ (format "called fun1: %s" data)) > #+end_src > > #+name: fun2 > #+begin_src elisp > (princ "called fun2") > #+end_src > I don't see an example of calling these blocks programmatically. I will research the docs a bit more. Thanks! > On Sat, Feb 20, 2021 at 2:11 PM Nathan Neff wrote: > > > > Hello all, > > > > I have some code like this: > > > > * Heading 1 > > > > # code block name:FOO > > > > ** Subheading 1 > > > > # code block > > > > ** Subheading 2 > > > > # code block > > > > I find that I often want to evaluate the code in Heading 1 and its > subheadings. > > > > Currently, I navigate to Heading 1 and then use org-babel-execute-subtree > > > > I see that there's a function called org-babel-goto-named-src-block, so > I think > > I could write a small function to jump to FOO in Heading 1 and then run > execute subtree > > and then jump back to my previous location in Emacs. > > > > Is there a more programmatic or built-in way? For example: > > org-babel-execute-block-and-subheadings FOO > > > > Thanks, > > --Nate > --0000000000009bad8605bc70272a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, Feb 27, 2021 at 7:18 AM ian m= artins <ianxm@jhu.edu> wrote:
Can you use noweb? In the example below, if you run= the top code block
babel will run the two that follow.

Hi = Ian, yes, I can run the top code block *manually* by navigating to that
block and then evaluating it.=C2=A0 I would like to define a keyboar= d shortcut that
will call the function and its subheadings' f= unctions.
=C2=A0

A drawback is that you have to redefine variables, but it might be a
benefit, since the individual blocks could be set with test data and
the "main driver" could point to real data.
-------

#+begin_src elisp :results output :noweb yes :var data=3Ddata1
=C2=A0 <<fun1>>
=C2=A0 <<fun2>>
#+end_src

#+RESULTS:
: called fun1: some data
: called fun2

#+name: data1
some data

#+name: fun1
#+begin_src elisp :var data=3Ddata1
(princ (format "called fun1: %s" data))
#+end_src

#+name: fun2
#+begin_src elisp
(princ "called fun2")
#+end_src

I don't see an example of= calling these blocks programmatically. =C2=A0
I will research th= e docs a bit more.=C2=A0 Thanks!


On Sat, Feb 20, 2021 at 2:11 PM Nathan Neff <nathan.neff@gmail.com> wrote:
>
> Hello all,
>
> I have some code like this:
>
> * Heading 1
>
> # code block name:FOO
>
> ** Subheading 1
>
> # code block
>
> ** Subheading 2
>
> # code block
>
> I find that I often want to evaluate the code in Heading 1 and its sub= headings.
>
> Currently, I navigate to Heading 1 and then use org-babel-execute-subt= ree
>
> I see that there's a function called org-babel-goto-named-src-bloc= k, so I think
> I could write a small function to jump to FOO in Heading 1 and then ru= n execute subtree
> and then jump back to my previous location in Emacs.
>
> Is there a more programmatic or built-in way?=C2=A0 For example:
> org-babel-execute-block-and-subheadings FOO
>
> Thanks,
> --Nate
--0000000000009bad8605bc70272a--