From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 8NkYIt1GOmA5dgAA0tVLHw (envelope-from ) for ; Sat, 27 Feb 2021 13:19:25 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4CzzHd1GOmCYHwAA1q6Kng (envelope-from ) for ; Sat, 27 Feb 2021 13:19:25 +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 aspmx2.migadu.com (Postfix) with ESMTPS id C258610EEF for ; Sat, 27 Feb 2021 14:19:24 +0100 (CET) Received: from localhost ([::1]:56688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFzVD-0002W8-H5 for larch@yhetil.org; Sat, 27 Feb 2021 08:19:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFzUq-0002Vp-Vl for emacs-orgmode@gnu.org; Sat, 27 Feb 2021 08:19:01 -0500 Received: from mail-ej1-f51.google.com ([209.85.218.51]:33860) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lFzUo-00008c-P8 for emacs-orgmode@gnu.org; Sat, 27 Feb 2021 08:19:00 -0500 Received: by mail-ej1-f51.google.com with SMTP id hs11so19522127ejc.1 for ; Sat, 27 Feb 2021 05:18:57 -0800 (PST) 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=XeWKXKp4v6DX98ORLzHji8Efq3H1kIuuIgonZuAnYOA=; b=lcyOZPjWWYkMmReUSe/3/wNMjzcbRLuCXiaF1R2PlEW2fpF74pOAxVJCWkxrZsbwHp NBb49MApZNWG+1m8YTFJctik+AQdtVaMyrtXh3hNhKhP5ShjmcM0OfgWHI1XlF441LwE wYItyLiDRkQb4fFCkVMEyXa0OHjwcz5kgh9aMUbf1OtwDCslkNIExE2s2VFE4w6ULe0Y YXlvuwHhnYDLMcXduKHKxlW1FGK6Jt7nSOytnVIKu2rBN7IOjZySZouLyufCvV3iyznn /VyKhhQJ7XvZy2OgjDxiZ37vt9U6BjvYvXKGdxJ/rNqAkaMWy97DSOG2A9cm0UiosHF3 k/SA== X-Gm-Message-State: AOAM5324UCujSaRG+FAkYBhqApTtSh44ITVWxhC+h/ybnt84m/XWHgoK iUQHOqFMcgnbSfPl+2XhMRTVxdVKIroXgJkJn5A= X-Google-Smtp-Source: ABdhPJwVT2aQPF/HdAsc4u3jxovNqdkivtaV0CZxBUBBiC7OCB4hukVBhIQRHMk8tz1k87xSrlojdxoMpitANW9Nkxw= X-Received: by 2002:a17:907:778b:: with SMTP id ky11mr8032200ejc.333.1614431936782; Sat, 27 Feb 2021 05:18:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: ian martins Date: Sat, 27 Feb 2021 08:18:45 -0500 Message-ID: Subject: Re: Babel: Programmatically evaluate a heading and subtrees? To: Nathan Neff Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=209.85.218.51; envelope-from=ianxm1@gmail.com; helo=mail-ej1-f51.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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=1614431964; 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; bh=XeWKXKp4v6DX98ORLzHji8Efq3H1kIuuIgonZuAnYOA=; b=SDFegGtqRgyGjxKuSVgMCSNsV0xCimokn29Aw80J6aREBdtslX5RYvJzcSVwG0ZKCh6iUn WURrIviBBulBfR89SV0aZa8CDTVtv1GGMUK/CI6EHb4OKLMtai4rWc3nTgGMXS7AlpS2Nr S3nQe9bk5dlrYVM1toSsHoJgHCaYscoP7WGtM/H8My0P6S3WzKgJBteeS0FXnafCwEUE0f qAHCl0livjLy4pR2sni9PpAzgIAKnMwUULZvkXWVP6AAqTnlBjNwwiLQWxaGA3oANqHbDO z3/A60ra9bSVEQeLL6oVVEx7E/6mqVfigRUT8kjMu0bshaWPgaVcLQzbM7PwAg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614431964; a=rsa-sha256; cv=none; b=iCW2IBkTvbOL0isPXVO+dcyqKTAXhi88HJpxi56nRfowt/Wp+xz/NYp1JOJ0y3PSkOGt6K b9p8NSM+donqvxIkR6ZYLlo+9swq+7p1YKRgm2z+zAz1+QxcGTxZujXBWtCwKR18nRNWMi rIyVNL+qruZPNIj6oXEG2wTRrwnhZi/JEUST5SCTayzRwBdEIGoa7INXTCddmYvqVRiZZk zR/31XgBxikVhZo0sEBKHPBsUbOLNYiF/jKcHBocf84GyhCpXEO0t+hYdavNgW3kxUJziL olsBsiSkF1F2AHylzsskyqyEn4pddGhWuwEfwktNnTYrPURQgjgftsTkChlNlw== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=none; spf=pass (aspmx2.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.23 Authentication-Results: aspmx2.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=jhu.edu (policy=none); spf=pass (aspmx2.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: C258610EEF X-Spam-Score: 0.23 X-Migadu-Scanner: scn0.migadu.com X-TUID: PbZAqmbpmwV9 Can you use noweb? In the example below, if you run the top code block babel will run the two that follow. 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 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